diff --git a/tests/cases/CLI/TestCLI.php b/tests/cases/CLI/TestCLI.php index 108e3280..d34e8b96 100644 --- a/tests/cases/CLI/TestCLI.php +++ b/tests/cases/CLI/TestCLI.php @@ -18,7 +18,7 @@ use Phake; class TestCLI extends \JKingWeb\Arsse\Test\AbstractTest { public function setUp() { - $this->clearData(false); + self::clearData(false); } public function assertConsole(CLI $cli, string $command, int $exitStatus, string $output = "", bool $pattern = false) { diff --git a/tests/cases/Conf/TestConf.php b/tests/cases/Conf/TestConf.php index 5aa56d8d..aab95b9f 100644 --- a/tests/cases/Conf/TestConf.php +++ b/tests/cases/Conf/TestConf.php @@ -15,7 +15,7 @@ class TestConf extends \JKingWeb\Arsse\Test\AbstractTest { public static $path; public function setUp() { - $this->clearData(); + self::clearData(); self::$vfs = vfsStream::setup("root", null, [ 'confGood' => ' "xx");', 'confNotArray' => 'clearData(); + self::clearData(); } public function testLoadDefaultValues() { diff --git a/tests/cases/Database/Base.php b/tests/cases/Database/Base.php index 711c3ccd..8f6f7b67 100644 --- a/tests/cases/Database/Base.php +++ b/tests/cases/Database/Base.php @@ -11,7 +11,7 @@ use JKingWeb\Arsse\Arsse; use JKingWeb\Arsse\Conf; use JKingWeb\Arsse\User; use JKingWeb\Arsse\Misc\ValueInfo; -use JKingWeb\Arsse\Test\Database; +use JKingWeb\Arsse\Database; use JKingWeb\Arsse\Db\Result; use Phake; @@ -23,12 +23,12 @@ abstract class Base { public function setUp() { // establish a clean baseline - $this->clearData(); + self::clearData(); self::setConf(); // configure and create the relevant database driver $this->setUpDriver(); // create the database interface with the suitable driver - Arsse::$db = new Database($this->drv); + Arsse::$db = new Database; Arsse::$db->driverSchemaUpdate(); // create a mock user manager Arsse::$user = Phake::mock(User::class); @@ -51,7 +51,7 @@ abstract class Base { // clean up $this->primed = false; $this->drv = null; - $this->clearData(); + self::clearData(); } public function primeDatabase(array $data, \JKingWeb\Arsse\Db\Driver $drv = null): bool { diff --git a/tests/cases/Database/SeriesArticle.php b/tests/cases/Database/SeriesArticle.php index 7ffae2d1..695fe3cb 100644 --- a/tests/cases/Database/SeriesArticle.php +++ b/tests/cases/Database/SeriesArticle.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Database; use JKingWeb\Arsse\Arsse; diff --git a/tests/cases/Database/SeriesCleanup.php b/tests/cases/Database/SeriesCleanup.php index 532c18de..fcb2393d 100644 --- a/tests/cases/Database/SeriesCleanup.php +++ b/tests/cases/Database/SeriesCleanup.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Arsse; use Phake; diff --git a/tests/cases/Database/SeriesFeed.php b/tests/cases/Database/SeriesFeed.php index 24a0097e..00475aef 100644 --- a/tests/cases/Database/SeriesFeed.php +++ b/tests/cases/Database/SeriesFeed.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Arsse; use JKingWeb\Arsse\Feed; diff --git a/tests/cases/Database/SeriesFolder.php b/tests/cases/Database/SeriesFolder.php index d2d5b251..6199d232 100644 --- a/tests/cases/Database/SeriesFolder.php +++ b/tests/cases/Database/SeriesFolder.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Arsse; use Phake; diff --git a/tests/cases/Database/SeriesLabel.php b/tests/cases/Database/SeriesLabel.php index c764b046..062d23e9 100644 --- a/tests/cases/Database/SeriesLabel.php +++ b/tests/cases/Database/SeriesLabel.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Arsse; use JKingWeb\Arsse\Misc\Context; diff --git a/tests/cases/Database/SeriesMeta.php b/tests/cases/Database/SeriesMeta.php index 58ae20dc..467c8e0b 100644 --- a/tests/cases/Database/SeriesMeta.php +++ b/tests/cases/Database/SeriesMeta.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Test\Database; use JKingWeb\Arsse\Arsse; diff --git a/tests/cases/Database/SeriesMiscellany.php b/tests/cases/Database/SeriesMiscellany.php index e58c4306..c5e0eb97 100644 --- a/tests/cases/Database/SeriesMiscellany.php +++ b/tests/cases/Database/SeriesMiscellany.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Arsse; use JKingWeb\Arsse\Database; diff --git a/tests/cases/Database/SeriesSession.php b/tests/cases/Database/SeriesSession.php index 26cf58ab..e605b868 100644 --- a/tests/cases/Database/SeriesSession.php +++ b/tests/cases/Database/SeriesSession.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Arsse; use JKingWeb\Arsse\Misc\Date; diff --git a/tests/cases/Database/SeriesSubscription.php b/tests/cases/Database/SeriesSubscription.php index a04fcf62..7e3a3941 100644 --- a/tests/cases/Database/SeriesSubscription.php +++ b/tests/cases/Database/SeriesSubscription.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Arsse; use JKingWeb\Arsse\Test\Database; diff --git a/tests/cases/Database/SeriesUser.php b/tests/cases/Database/SeriesUser.php index 78d1f81b..402dec6f 100644 --- a/tests/cases/Database/SeriesUser.php +++ b/tests/cases/Database/SeriesUser.php @@ -4,7 +4,7 @@ * See LICENSE and AUTHORS files for details */ declare(strict_types=1); -namespace JKingWeb\Arsse\Test\Database; +namespace JKingWeb\Arsse\TestCase\Database; use JKingWeb\Arsse\Arsse; use JKingWeb\Arsse\User\Driver as UserDriver; diff --git a/tests/cases/Db/BaseDriver.php b/tests/cases/Db/BaseDriver.php index 653da327..46244080 100644 --- a/tests/cases/Db/BaseDriver.php +++ b/tests/cases/Db/BaseDriver.php @@ -22,7 +22,7 @@ abstract class BaseDriver extends \JKingWeb\Arsse\Test\AbstractTest { ]; public function setUp() { - $this->clearData(); + self::clearData(); self::setConf($this->conf); $info = new DatabaseInformation($this->implementation); $this->interface = ($info->interfaceConstructor)(); @@ -37,7 +37,7 @@ abstract class BaseDriver extends \JKingWeb\Arsse\Test\AbstractTest { } public function tearDown() { - $this->clearData(); + self::clearData(); unset($this->drv); try { $this->exec("ROLLBACK"); diff --git a/tests/cases/Db/BaseResult.php b/tests/cases/Db/BaseResult.php index 8a79d747..96dae042 100644 --- a/tests/cases/Db/BaseResult.php +++ b/tests/cases/Db/BaseResult.php @@ -18,7 +18,7 @@ abstract class BaseResult extends \JKingWeb\Arsse\Test\AbstractTest { abstract protected function makeResult(string $q): array; public function setUp() { - $this->clearData(); + self::clearData(); self::setConf(); $info = new DatabaseInformation($this->implementation); $this->interface = ($info->interfaceConstructor)(); @@ -31,7 +31,7 @@ abstract class BaseResult extends \JKingWeb\Arsse\Test\AbstractTest { } public function tearDown() { - $this->clearData(); + self::clearData(); $this->exec("DROP TABLE IF EXISTS arsse_meta"); } diff --git a/tests/cases/Db/BaseStatement.php b/tests/cases/Db/BaseStatement.php index 86705446..4369f7ac 100644 --- a/tests/cases/Db/BaseStatement.php +++ b/tests/cases/Db/BaseStatement.php @@ -19,7 +19,7 @@ abstract class BaseStatement extends \JKingWeb\Arsse\Test\AbstractTest { abstract protected function decorateTypeSyntax(string $value, string $type): string; public function setUp() { - $this->clearData(); + self::clearData(); self::setConf(); $info = new DatabaseInformation($this->implementation); $this->interface = ($info->interfaceConstructor)(); @@ -33,7 +33,7 @@ abstract class BaseStatement extends \JKingWeb\Arsse\Test\AbstractTest { public function tearDown() { $this->exec("DROP TABLE IF EXISTS arsse_meta"); - $this->clearData(); + self::clearData(); } public function testConstructStatement() { diff --git a/tests/cases/Db/SQLite3/Database/TestArticle.php b/tests/cases/Db/SQLite3/Database/TestArticle.php deleted file mode 100644 index 9531d4d1..00000000 --- a/tests/cases/Db/SQLite3/Database/TestArticle.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestArticle extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesArticle; -} diff --git a/tests/cases/Db/SQLite3/Database/TestCleanup.php b/tests/cases/Db/SQLite3/Database/TestCleanup.php deleted file mode 100644 index 5374e1b4..00000000 --- a/tests/cases/Db/SQLite3/Database/TestCleanup.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestCleanup extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesCleanup; -} diff --git a/tests/cases/Db/SQLite3/Database/TestFeed.php b/tests/cases/Db/SQLite3/Database/TestFeed.php deleted file mode 100644 index e46a17fe..00000000 --- a/tests/cases/Db/SQLite3/Database/TestFeed.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesFeed; -} diff --git a/tests/cases/Db/SQLite3/Database/TestFolder.php b/tests/cases/Db/SQLite3/Database/TestFolder.php deleted file mode 100644 index bc88e9af..00000000 --- a/tests/cases/Db/SQLite3/Database/TestFolder.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestFolder extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesFolder; -} diff --git a/tests/cases/Db/SQLite3/Database/TestLabel.php b/tests/cases/Db/SQLite3/Database/TestLabel.php deleted file mode 100644 index 70923207..00000000 --- a/tests/cases/Db/SQLite3/Database/TestLabel.php +++ /dev/null @@ -1,13 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestLabel extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesLabel; -} diff --git a/tests/cases/Db/SQLite3/Database/TestMeta.php b/tests/cases/Db/SQLite3/Database/TestMeta.php deleted file mode 100644 index 0693d302..00000000 --- a/tests/cases/Db/SQLite3/Database/TestMeta.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestMeta extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesMeta; -} diff --git a/tests/cases/Db/SQLite3/Database/TestMiscellany.php b/tests/cases/Db/SQLite3/Database/TestMiscellany.php deleted file mode 100644 index 77014288..00000000 --- a/tests/cases/Db/SQLite3/Database/TestMiscellany.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestMiscellany extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesMiscellany; -} diff --git a/tests/cases/Db/SQLite3/Database/TestSession.php b/tests/cases/Db/SQLite3/Database/TestSession.php deleted file mode 100644 index f8344b52..00000000 --- a/tests/cases/Db/SQLite3/Database/TestSession.php +++ /dev/null @@ -1,13 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestSession extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesSession; -} diff --git a/tests/cases/Db/SQLite3/Database/TestSubscription.php b/tests/cases/Db/SQLite3/Database/TestSubscription.php deleted file mode 100644 index c7c6c57e..00000000 --- a/tests/cases/Db/SQLite3/Database/TestSubscription.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestSubscription extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesSubscription; -} diff --git a/tests/cases/Db/SQLite3/Database/TestUser.php b/tests/cases/Db/SQLite3/Database/TestUser.php deleted file mode 100644 index 3659bf9f..00000000 --- a/tests/cases/Db/SQLite3/Database/TestUser.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestUser extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3; - use \JKingWeb\Arsse\Test\Database\SeriesUser; -} diff --git a/tests/cases/Db/SQLite3/TestCreation.php b/tests/cases/Db/SQLite3/TestCreation.php index 124c76a0..d85aecdc 100644 --- a/tests/cases/Db/SQLite3/TestCreation.php +++ b/tests/cases/Db/SQLite3/TestCreation.php @@ -24,7 +24,7 @@ class TestCreation extends \JKingWeb\Arsse\Test\AbstractTest { if (!Driver::requirementsMet()) { $this->markTestSkipped("SQLite extension not loaded"); } - $this->clearData(); + self::clearData(); // test files $this->files = [ // cannot create files @@ -111,7 +111,7 @@ class TestCreation extends \JKingWeb\Arsse\Test\AbstractTest { } public function tearDown() { - $this->clearData(); + self::clearData(); } public function testFailToCreateDatabase() { diff --git a/tests/cases/Db/SQLite3/TestDriver.php b/tests/cases/Db/SQLite3/TestDriver.php index 58ef4bfd..df802106 100644 --- a/tests/cases/Db/SQLite3/TestDriver.php +++ b/tests/cases/Db/SQLite3/TestDriver.php @@ -48,7 +48,7 @@ class TestDriver extends \JKingWeb\Arsse\TestCase\Db\BaseDriver { } public function provideDrivers() { - $this->clearData(); + self::clearData(); self::setConf([ 'dbTimeoutExec' => 0.5, 'dbSQLite3Timeout' => 0, diff --git a/tests/cases/Db/SQLite3/TestUpdate.php b/tests/cases/Db/SQLite3/TestUpdate.php index a2a70b0b..1c219a1d 100644 --- a/tests/cases/Db/SQLite3/TestUpdate.php +++ b/tests/cases/Db/SQLite3/TestUpdate.php @@ -29,7 +29,7 @@ class TestUpdate extends \JKingWeb\Arsse\Test\AbstractTest { if (!Driver::requirementsMet()) { $this->markTestSkipped("SQLite extension not loaded"); } - $this->clearData(); + self::clearData(); $this->vfs = vfsStream::setup("schemata", null, ['SQLite3' => []]); self::setConf($conf); $this->base = $this->vfs->url(); @@ -41,7 +41,7 @@ class TestUpdate extends \JKingWeb\Arsse\Test\AbstractTest { unset($this->drv); unset($this->data); unset($this->vfs); - $this->clearData(); + self::clearData(); } public function testLoadMissingFile() { diff --git a/tests/cases/Db/SQLite3PDO/Database/TestArticle.php b/tests/cases/Db/SQLite3PDO/Database/TestArticle.php deleted file mode 100644 index 30521b42..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestArticle.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestArticle extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesArticle; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestCleanup.php b/tests/cases/Db/SQLite3PDO/Database/TestCleanup.php deleted file mode 100644 index 708001d4..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestCleanup.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestCleanup extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesCleanup; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestFeed.php b/tests/cases/Db/SQLite3PDO/Database/TestFeed.php deleted file mode 100644 index e662d8e6..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestFeed.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesFeed; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestFolder.php b/tests/cases/Db/SQLite3PDO/Database/TestFolder.php deleted file mode 100644 index 777a0110..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestFolder.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestFolder extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesFolder; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestLabel.php b/tests/cases/Db/SQLite3PDO/Database/TestLabel.php deleted file mode 100644 index b2fe1580..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestLabel.php +++ /dev/null @@ -1,13 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestLabel extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesLabel; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestMeta.php b/tests/cases/Db/SQLite3PDO/Database/TestMeta.php deleted file mode 100644 index 96981311..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestMeta.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestMeta extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesMeta; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestMiscellany.php b/tests/cases/Db/SQLite3PDO/Database/TestMiscellany.php deleted file mode 100644 index 868e7fc5..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestMiscellany.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestMiscellany extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesMiscellany; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestSession.php b/tests/cases/Db/SQLite3PDO/Database/TestSession.php deleted file mode 100644 index 88535b2b..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestSession.php +++ /dev/null @@ -1,13 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestSession extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesSession; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestSubscription.php b/tests/cases/Db/SQLite3PDO/Database/TestSubscription.php deleted file mode 100644 index 83e7daf8..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestSubscription.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestSubscription extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesSubscription; -} diff --git a/tests/cases/Db/SQLite3PDO/Database/TestUser.php b/tests/cases/Db/SQLite3PDO/Database/TestUser.php deleted file mode 100644 index 18b0c05a..00000000 --- a/tests/cases/Db/SQLite3PDO/Database/TestUser.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @covers \JKingWeb\Arsse\Misc\Query - */ -class TestUser extends \JKingWeb\Arsse\Test\AbstractTest { - use \JKingWeb\Arsse\Test\Database\Setup; - use \JKingWeb\Arsse\Test\Database\DriverSQLite3PDO; - use \JKingWeb\Arsse\Test\Database\SeriesUser; -} diff --git a/tests/cases/Db/SQLite3PDO/TestCreation.php b/tests/cases/Db/SQLite3PDO/TestCreation.php index acae72b1..526400b8 100644 --- a/tests/cases/Db/SQLite3PDO/TestCreation.php +++ b/tests/cases/Db/SQLite3PDO/TestCreation.php @@ -25,7 +25,7 @@ class TestCreation extends \JKingWeb\Arsse\Test\AbstractTest { if (!Driver::requirementsMet()) { $this->markTestSkipped("PDO-SQLite extension not loaded"); } - $this->clearData(); + self::clearData(); // test files $this->files = [ // cannot create files @@ -112,7 +112,7 @@ class TestCreation extends \JKingWeb\Arsse\Test\AbstractTest { } public function tearDown() { - $this->clearData(); + self::clearData(); } public function testFailToCreateDatabase() { diff --git a/tests/cases/Db/SQLite3PDO/TestUpdate.php b/tests/cases/Db/SQLite3PDO/TestUpdate.php index 409de79c..58caca37 100644 --- a/tests/cases/Db/SQLite3PDO/TestUpdate.php +++ b/tests/cases/Db/SQLite3PDO/TestUpdate.php @@ -29,7 +29,7 @@ class TestUpdate extends \JKingWeb\Arsse\Test\AbstractTest { if (!PDODriver::requirementsMet()) { $this->markTestSkipped("PDO-SQLite extension not loaded"); } - $this->clearData(); + self::clearData(); $this->vfs = vfsStream::setup("schemata", null, ['SQLite3' => []]); $conf['dbDriver'] = PDODriver::class; self::setConf($conf); @@ -42,7 +42,7 @@ class TestUpdate extends \JKingWeb\Arsse\Test\AbstractTest { unset($this->drv); unset($this->data); unset($this->vfs); - $this->clearData(); + self::clearData(); } public function testLoadMissingFile() { diff --git a/tests/cases/Db/TestTransaction.php b/tests/cases/Db/TestTransaction.php index 9469d6c2..22b445a5 100644 --- a/tests/cases/Db/TestTransaction.php +++ b/tests/cases/Db/TestTransaction.php @@ -16,7 +16,7 @@ class TestTransaction extends \JKingWeb\Arsse\Test\AbstractTest { protected $drv; public function setUp() { - $this->clearData(); + self::clearData(); $drv = Phake::mock(\JKingWeb\Arsse\Db\SQLite3\Driver::class); Phake::when($drv)->savepointRelease->thenReturn(true); Phake::when($drv)->savepointUndo->thenReturn(true); diff --git a/tests/cases/Exception/TestException.php b/tests/cases/Exception/TestException.php index f77ce371..05d1d928 100644 --- a/tests/cases/Exception/TestException.php +++ b/tests/cases/Exception/TestException.php @@ -15,7 +15,7 @@ use Phake; /** @covers \JKingWeb\Arsse\AbstractException */ class TestException extends \JKingWeb\Arsse\Test\AbstractTest { public function setUp() { - $this->clearData(false); + self::clearData(false); // create a mock Lang object so as not to create a dependency loop Arsse::$lang = Phake::mock(Lang::class); Phake::when(Arsse::$lang)->msg->thenReturn(""); @@ -26,7 +26,7 @@ class TestException extends \JKingWeb\Arsse\Test\AbstractTest { Phake::verify(Arsse::$lang, Phake::atLeast(0))->msg($this->isType("string"), $this->anything()); Phake::verifyNoOtherInteractions(Arsse::$lang); // clean up - $this->clearData(true); + self::clearData(true); } public function testBaseClass() { diff --git a/tests/cases/Feed/TestFeed.php b/tests/cases/Feed/TestFeed.php index 01e9022d..d133ee7f 100644 --- a/tests/cases/Feed/TestFeed.php +++ b/tests/cases/Feed/TestFeed.php @@ -95,7 +95,7 @@ class TestFeed extends \JKingWeb\Arsse\Test\AbstractTest { $this->markTestSkipped("Test Web server is not accepting requests"); } $this->base = self::$host."Feed/"; - $this->clearData(); + self::clearData(); self::setConf(); Arsse::$db = Phake::mock(Database::class); } diff --git a/tests/cases/Feed/TestFetching.php b/tests/cases/Feed/TestFetching.php index 64102b9d..11602b55 100644 --- a/tests/cases/Feed/TestFetching.php +++ b/tests/cases/Feed/TestFetching.php @@ -25,7 +25,7 @@ class TestFetching extends \JKingWeb\Arsse\Test\AbstractTest { $this->markTestSkipped("Test Web server is not accepting requests"); } $this->base = self::$host."Feed/"; - $this->clearData(); + self::clearData(); self::setConf(); } diff --git a/tests/cases/Misc/TestDate.php b/tests/cases/Misc/TestDate.php index e82f6c8b..7fdae602 100644 --- a/tests/cases/Misc/TestDate.php +++ b/tests/cases/Misc/TestDate.php @@ -11,7 +11,7 @@ use JKingWeb\Arsse\Misc\Date; /** @covers \JKingWeb\Arsse\Misc\Date */ class TestDate extends \JKingWeb\Arsse\Test\AbstractTest { public function setUp() { - $this->clearData(); + self::clearData(); } public function testNormalizeADate() { diff --git a/tests/cases/Misc/TestValueInfo.php b/tests/cases/Misc/TestValueInfo.php index e6dbdf4d..2d0973e1 100644 --- a/tests/cases/Misc/TestValueInfo.php +++ b/tests/cases/Misc/TestValueInfo.php @@ -14,7 +14,7 @@ use JKingWeb\Arsse\Test\Result; /** @covers \JKingWeb\Arsse\Misc\ValueInfo */ class TestValueInfo extends \JKingWeb\Arsse\Test\AbstractTest { public function setUp() { - $this->clearData(); + self::clearData(); } public function testGetIntegerInfo() { diff --git a/tests/cases/REST/NextCloudNews/TestV1_2.php b/tests/cases/REST/NextCloudNews/TestV1_2.php index 22f3ab6a..f7936f45 100644 --- a/tests/cases/REST/NextCloudNews/TestV1_2.php +++ b/tests/cases/REST/NextCloudNews/TestV1_2.php @@ -339,7 +339,7 @@ class TestV1_2 extends \JKingWeb\Arsse\Test\AbstractTest { } public function setUp() { - $this->clearData(); + self::clearData(); self::setConf(); // create a mock user manager Arsse::$user = Phake::mock(User::class); @@ -352,7 +352,7 @@ class TestV1_2 extends \JKingWeb\Arsse\Test\AbstractTest { } public function tearDown() { - $this->clearData(); + self::clearData(); } protected function v($value) { diff --git a/tests/cases/REST/NextCloudNews/TestVersions.php b/tests/cases/REST/NextCloudNews/TestVersions.php index 28c6e0ca..c803f8d6 100644 --- a/tests/cases/REST/NextCloudNews/TestVersions.php +++ b/tests/cases/REST/NextCloudNews/TestVersions.php @@ -15,7 +15,7 @@ use Zend\Diactoros\Response\EmptyResponse; /** @covers \JKingWeb\Arsse\REST\NextCloudNews\Versions */ class TestVersions extends \JKingWeb\Arsse\Test\AbstractTest { public function setUp() { - $this->clearData(); + self::clearData(); } protected function req(string $method, string $target): ResponseInterface { diff --git a/tests/cases/REST/TinyTinyRSS/TestAPI.php b/tests/cases/REST/TinyTinyRSS/TestAPI.php index eb6ead75..10fc535d 100644 --- a/tests/cases/REST/TinyTinyRSS/TestAPI.php +++ b/tests/cases/REST/TinyTinyRSS/TestAPI.php @@ -176,7 +176,7 @@ LONG_STRING; } public function setUp() { - $this->clearData(); + self::clearData(); self::setConf(); // create a mock user manager Arsse::$user = Phake::mock(User::class); @@ -196,7 +196,7 @@ LONG_STRING; } public function tearDown() { - $this->clearData(); + self::clearData(); } public function testHandleInvalidPaths() { diff --git a/tests/cases/REST/TinyTinyRSS/TestIcon.php b/tests/cases/REST/TinyTinyRSS/TestIcon.php index e25c6712..bacf3bec 100644 --- a/tests/cases/REST/TinyTinyRSS/TestIcon.php +++ b/tests/cases/REST/TinyTinyRSS/TestIcon.php @@ -23,7 +23,7 @@ class TestIcon extends \JKingWeb\Arsse\Test\AbstractTest { protected $user = "john.doe@example.com"; public function setUp() { - $this->clearData(); + self::clearData(); self::setConf(); // create a mock user manager Arsse::$user = Phake::mock(User::class); @@ -33,7 +33,7 @@ class TestIcon extends \JKingWeb\Arsse\Test\AbstractTest { } public function tearDown() { - $this->clearData(); + self::clearData(); } protected function req(string $target, string $method = "GET", string $user = null): ResponseInterface { diff --git a/tests/cases/Service/TestService.php b/tests/cases/Service/TestService.php index 69eec5f0..4373c632 100644 --- a/tests/cases/Service/TestService.php +++ b/tests/cases/Service/TestService.php @@ -18,7 +18,7 @@ class TestService extends \JKingWeb\Arsse\Test\AbstractTest { protected $srv; public function setUp() { - $this->clearData(); + self::clearData(); self::setConf(); Arsse::$db = Phake::mock(Database::class); $this->srv = new Service(); diff --git a/tests/cases/User/TestInternal.php b/tests/cases/User/TestInternal.php index a1f95dea..bc43377f 100644 --- a/tests/cases/User/TestInternal.php +++ b/tests/cases/User/TestInternal.php @@ -19,7 +19,7 @@ use Phake; class TestInternal extends \JKingWeb\Arsse\Test\AbstractTest { public function setUp() { - $this->clearData(); + self::clearData(); self::setConf(); // create a mock database interface Arsse::$db = Phake::mock(Database::class); diff --git a/tests/cases/User/TestUser.php b/tests/cases/User/TestUser.php index c576245f..fbb47627 100644 --- a/tests/cases/User/TestUser.php +++ b/tests/cases/User/TestUser.php @@ -19,7 +19,7 @@ use Phake; class TestUser extends \JKingWeb\Arsse\Test\AbstractTest { public function setUp() { - $this->clearData(); + self::clearData(); self::setConf(); // create a mock database interface Arsse::$db = Phake::mock(Database::class); diff --git a/tests/lib/AbstractTest.php b/tests/lib/AbstractTest.php index a15d6748..addcc79c 100644 --- a/tests/lib/AbstractTest.php +++ b/tests/lib/AbstractTest.php @@ -21,14 +21,14 @@ use Zend\Diactoros\Response\EmptyResponse; /** @coversNothing */ abstract class AbstractTest extends \PHPUnit\Framework\TestCase { public function setUp() { - $this->clearData(); + self::clearData(); } public function tearDown() { - $this->clearData(); + self::clearData(); } - public function clearData(bool $loadLang = true) { + public static function clearData(bool $loadLang = true) { date_default_timezone_set("America/Toronto"); $r = new \ReflectionClass(\JKingWeb\Arsse\Arsse::class); $props = array_keys($r->getStaticProperties()); diff --git a/tests/lib/Database/Setup.php b/tests/lib/Database/Setup.php index 88a01d11..b3c749d1 100644 --- a/tests/lib/Database/Setup.php +++ b/tests/lib/Database/Setup.php @@ -21,7 +21,7 @@ trait Setup { public function setUp() { // establish a clean baseline - $this->clearData(); + self::clearData(); self::setConf(); // configure and create the relevant database driver $this->setUpDriver(); @@ -49,7 +49,7 @@ trait Setup { // clean up $this->primed = false; $this->drv = null; - $this->clearData(); + self::clearData(); } public function primeDatabase(array $data, \JKingWeb\Arsse\Db\Driver $drv = null): bool { diff --git a/tests/lib/Lang/Setup.php b/tests/lib/Lang/Setup.php index 76843bb5..861dd413 100644 --- a/tests/lib/Lang/Setup.php +++ b/tests/lib/Lang/Setup.php @@ -39,7 +39,7 @@ trait Setup { // make the test Lang class use the vfs files $this->l = new TestLang($this->path); // create a mock Lang object so as not to create a dependency loop - $this->clearData(false); + self::clearData(false); Arsse::$lang = Phake::mock(Lang::class); Phake::when(Arsse::$lang)->msg->thenReturn(""); // call the additional setup method if it exists @@ -53,7 +53,7 @@ trait Setup { Phake::verify(Arsse::$lang, Phake::atLeast(0))->msg($this->isType("string"), $this->anything()); Phake::verifyNoOtherInteractions(Arsse::$lang); // clean up - $this->clearData(true); + self::clearData(true); // call the additional teardiwn method if it exists if (method_exists($this, "tearDownSeries")) { $this->tearDownSeries();