mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 17:12:41 +00:00
11b2066922
Includes PHPDoc license tag in the file-level block with accompanying copyright notice. Also added an AUTHORS file on the off chance of outside contributions
24 lines
693 B
PHP
24 lines
693 B
PHP
<?php
|
|
/** @license MIT
|
|
* Copyright 2017 J. King, Dustin Wilson et al.
|
|
* See LICENSE and AUTHORS files for details */
|
|
|
|
declare(strict_types=1);
|
|
namespace JKingWeb\Arsse\Test\Database;
|
|
|
|
use JKingWeb\Arsse\Arsse;
|
|
use JKingWeb\Arsse\Db\SQLite3\Driver;
|
|
|
|
trait DriverSQLite3 {
|
|
public function setUpDriver() {
|
|
if (!extension_loaded("sqlite3")) {
|
|
$this->markTestSkipped("SQLite extension not loaded");
|
|
}
|
|
Arsse::$conf->dbSQLite3File = ":memory:";
|
|
$this->drv = new Driver();
|
|
}
|
|
|
|
public function nextID(string $table): int {
|
|
return $this->drv->query("SELECT (case when max(id) then max(id) else 0 end)+1 from $table")->getValue();
|
|
}
|
|
}
|