mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
Make data clearing in tests static
This commit is contained in:
parent
39110858b7
commit
7340d65c0e
57 changed files with 56 additions and 380 deletions
|
@ -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) {
|
||||
|
|
|
@ -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' => '<?php return Array("lang" => "xx");',
|
||||
'confNotArray' => '<?php return 0;',
|
||||
|
@ -35,7 +35,7 @@ class TestConf extends \JKingWeb\Arsse\Test\AbstractTest {
|
|||
public function tearDown() {
|
||||
self::$path = null;
|
||||
self::$vfs = null;
|
||||
$this->clearData();
|
||||
self::clearData();
|
||||
}
|
||||
|
||||
public function testLoadDefaultValues() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace JKingWeb\Arsse\TestCase\Db\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace JKingWeb\Arsse\TestCase\Db\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -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() {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace JKingWeb\Arsse\TestCase\Db\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace JKingWeb\Arsse\TestCase\Db\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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\SQLite3PDO\Database;
|
||||
|
||||
/**
|
||||
* @covers \JKingWeb\Arsse\Database<extended>
|
||||
* @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;
|
||||
}
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue