1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Mostly successful MySQL database function tests

Two failures remain, at least one requiring query munging.
This commit is contained in:
J. King 2018-12-21 10:14:26 -05:00
parent de07352fd0
commit 24df564045
4 changed files with 24 additions and 0 deletions

View file

@ -40,6 +40,7 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
$db = Arsse::$conf->dbMySQLDb ?? "arsse";
$this->makeConnection($user, $pass, $db, $host, $port, $socket ?? "");
$this->exec("SET lock_wait_timeout = 1");
$this->exec("SET time_zone = '+00:00'");
}
/** @codeCoverageIgnore */

View file

@ -0,0 +1,21 @@
<?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\TestCase\Db\MySQLPDO;
/**
* @group slow
* @group coverageOptional
* @covers \JKingWeb\Arsse\Database<extended>
* @covers \JKingWeb\Arsse\Misc\Query<extended>
*/
class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\Base {
protected static $implementation = "PDO MySQL";
protected function nextID(string $table): int {
return (int) (static::$drv->query("SELECT auto_increment from information_schema.tables where table_name = '$table'")->getValue() ?? 1);
}
}

View file

@ -186,6 +186,7 @@ class DatabaseInformation {
} else {
$db->query("DELETE FROM $table");
}
$db->query("ALTER TABLE $table auto_increment = 1");
}
foreach ($afterStatements as $st) {
$db->query($st);

View file

@ -80,6 +80,7 @@
<file>cases/Db/SQLite3PDO/TestDatabase.php</file>
<file>cases/Db/PostgreSQL/TestDatabase.php</file>
<file>cases/Db/PostgreSQLPDO/TestDatabase.php</file>
<file>cases/Db/MySQLPDO/TestDatabase.php</file>
</testsuite>
<testsuite name="REST">
<file>cases/REST/TestTarget.php</file>