1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 17:12:41 +00:00
Arsse/tests/lib/Database/SeriesMiscellany.php
J. King 5cd7268c0a Added incorrectDbCharset to NCNv1 server status
This has been exposed since version 11.0.3, released before our version 0.1.0, but after implementation work had begun
2017-11-29 18:14:59 -05:00

37 lines
1.2 KiB
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\Database;
trait SeriesMiscellany {
public function testListDrivers() {
$exp = [
'JKingWeb\\Arsse\\Db\\SQLite3\\Driver' => Arsse::$lang->msg("Driver.Db.SQLite3.Name"),
];
$this->assertArraySubset($exp, Database::driverList());
}
public function testInitializeDatabase() {
$d = new Database();
$this->assertSame(Database::SCHEMA_VERSION, $d->driverSchemaVersion());
}
public function testManuallyInitializeDatabase() {
$d = new Database(false);
$this->assertSame(0, $d->driverSchemaVersion());
$this->assertTrue($d->driverSchemaUpdate());
$this->assertSame(Database::SCHEMA_VERSION, $d->driverSchemaVersion());
$this->assertFalse($d->driverSchemaUpdate());
}
public function testCheckCharacterSetAcceptability() {
$d = new Database();
$this->assertInternalType("bool", $d->driverCharsetAcceptable());
}
}