diff --git a/tests/cases/Db/BaseDriver.php b/tests/cases/Db/BaseDriver.php index fd8cb5a9..5f309916 100644 --- a/tests/cases/Db/BaseDriver.php +++ b/tests/cases/Db/BaseDriver.php @@ -49,14 +49,14 @@ abstract class BaseDriver extends \JKingWeb\Arsse\Test\AbstractTest { public function tearDown() { // deconstruct the driver unset($this->drv); - if (static::$interface) { - // completely clear the database - (static::$dbInfo->razeFunction)(static::$interface); - } self::clearData(); } public static function tearDownAfterClass() { + if (static::$interface) { + // completely clear the database + (static::$dbInfo->razeFunction)(static::$interface); + } static::$interface = null; static::$dbInfo = null; self::clearData(); diff --git a/tests/cases/Db/BaseResult.php b/tests/cases/Db/BaseResult.php index a2159e46..bb1725bf 100644 --- a/tests/cases/Db/BaseResult.php +++ b/tests/cases/Db/BaseResult.php @@ -38,15 +38,15 @@ abstract class BaseResult extends \JKingWeb\Arsse\Test\AbstractTest { } public function tearDown() { - if (static::$interface) { - // completely clear the database - (static::$dbInfo->razeFunction)(static::$interface); - } self::clearData(); } public static function tearDownAfterClass() { - static::$implementation = null; + if (static::$interface) { + // completely clear the database + (static::$dbInfo->razeFunction)(static::$interface); + } + static::$interface = null; static::$dbInfo = null; self::clearData(); } diff --git a/tests/cases/Db/BaseStatement.php b/tests/cases/Db/BaseStatement.php index 92750e95..c3c3704e 100644 --- a/tests/cases/Db/BaseStatement.php +++ b/tests/cases/Db/BaseStatement.php @@ -39,15 +39,15 @@ abstract class BaseStatement extends \JKingWeb\Arsse\Test\AbstractTest { } public function tearDown() { - if (static::$interface) { - // completely clear the database - (static::$dbInfo->razeFunction)(static::$interface); - } self::clearData(); } public static function tearDownAfterClass() { - static::$implementation = null; + if (static::$interface) { + // completely clear the database + (static::$dbInfo->razeFunction)(static::$interface); + } + static::$interface = null; static::$dbInfo = null; self::clearData(); } diff --git a/tests/cases/Db/BaseUpdate.php b/tests/cases/Db/BaseUpdate.php index b4de0ea3..28cde468 100644 --- a/tests/cases/Db/BaseUpdate.php +++ b/tests/cases/Db/BaseUpdate.php @@ -48,16 +48,16 @@ class BaseUpdate extends \JKingWeb\Arsse\Test\AbstractTest { public function tearDown() { // deconstruct the driver unset($this->drv); - if (static::$interface) { - // completely clear the database - (static::$dbInfo->razeFunction)(static::$interface); - } unset($this->path, $this->base, $this->vfs); self::clearData(); } public static function tearDownAfterClass() { - static::$implementation = null; + if (static::$interface) { + // completely clear the database + (static::$dbInfo->razeFunction)(static::$interface); + } + static::$interface = null; static::$dbInfo = null; self::clearData(); } diff --git a/tests/cases/Db/SQLite3/TestDriver.php b/tests/cases/Db/SQLite3/TestDriver.php index 9b2348a6..334a7843 100644 --- a/tests/cases/Db/SQLite3/TestDriver.php +++ b/tests/cases/Db/SQLite3/TestDriver.php @@ -25,9 +25,8 @@ class TestDriver extends \JKingWeb\Arsse\TestCase\Db\BaseDriver { } public static function tearDownAfterClass() { - if (static::$interface) { - static::$interface->close(); - } + static::$interface->close(); + static::$interface = null; parent::tearDownAfterClass(); @unlink(static::$file); static::$file = null; diff --git a/tests/cases/Db/SQLite3/TestResult.php b/tests/cases/Db/SQLite3/TestResult.php index 1b34a1d2..4f6780ac 100644 --- a/tests/cases/Db/SQLite3/TestResult.php +++ b/tests/cases/Db/SQLite3/TestResult.php @@ -17,9 +17,8 @@ class TestResult extends \JKingWeb\Arsse\TestCase\Db\BaseResult { protected static $createTest = "CREATE TABLE arsse_test(id integer primary key)"; public static function tearDownAfterClass() { - if (static::$interface) { - static::$interface->close(); - } + static::$interface->close(); + static::$interface = null; parent::tearDownAfterClass(); } diff --git a/tests/cases/Db/SQLite3/TestStatement.php b/tests/cases/Db/SQLite3/TestStatement.php index 1684e832..7471b411 100644 --- a/tests/cases/Db/SQLite3/TestStatement.php +++ b/tests/cases/Db/SQLite3/TestStatement.php @@ -14,6 +14,7 @@ class TestStatement extends \JKingWeb\Arsse\TestCase\Db\BaseStatement { public static function tearDownAfterClass() { static::$interface->close(); + static::$interface = null; parent::tearDownAfterClass(); } diff --git a/tests/cases/Db/SQLite3/TestUpdate.php b/tests/cases/Db/SQLite3/TestUpdate.php index ecea58b9..53310850 100644 --- a/tests/cases/Db/SQLite3/TestUpdate.php +++ b/tests/cases/Db/SQLite3/TestUpdate.php @@ -13,4 +13,10 @@ class TestUpdate extends \JKingWeb\Arsse\TestCase\Db\BaseUpdate { protected static $implementation = "SQLite 3"; protected static $minimal1 = "create table arsse_meta(key text primary key not null, value text); pragma user_version=1"; protected static $minimal2 = "pragma user_version=2"; + + public static function tearDownAfterClass() { + static::$interface->close(); + static::$interface = null; + parent::tearDownAfterClass(); + } }