Browse Source

Correct spuriously failing tests

microsub
J. King 5 years ago
parent
commit
b8b559b0f8
  1. 2
      tests/cases/Database/SeriesArticle.php
  2. 2
      tests/cases/Db/MySQL/TestDatabase.php
  3. 2
      tests/cases/Db/MySQLPDO/TestDatabase.php

2
tests/cases/Database/SeriesArticle.php

@ -415,7 +415,7 @@ trait SeriesArticle {
/** @dataProvider provideContextMatches */
public function testListArticlesCheckingContext(Context $c, array $exp) {
$ids = array_column($ids = Arsse::$db->articleList("john.doe@example.com", $c)->getAll(), "id");
$ids = array_column($ids = Arsse::$db->articleList("john.doe@example.com", $c, ["id"], ["id"])->getAll(), "id");
sort($ids);
sort($exp);
$this->assertEquals($exp, $ids);

2
tests/cases/Db/MySQL/TestDatabase.php

@ -16,6 +16,6 @@ class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\Base {
use \JKingWeb\Arsse\TestCase\DatabaseDrivers\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);
return (int) (static::$drv->query("SELECT (case when max(id) then max(id) else 0 end)+1 from $table")->getValue() ?? 1);
}
}

2
tests/cases/Db/MySQLPDO/TestDatabase.php

@ -17,6 +17,6 @@ class TestDatabase extends \JKingWeb\Arsse\TestCase\Database\Base {
use \JKingWeb\Arsse\TestCase\DatabaseDrivers\MySQLPDO;
protected function nextID(string $table): int {
return (int) (static::$drv->query("SELECT auto_increment from information_schema.tables where table_name = '$table'")->getValue() ?? 1);
return (int) (static::$drv->query("SELECT (case when max(id) then max(id) else 0 end)+1 from $table")->getValue() ?? 1);
}
}

Loading…
Cancel
Save