diff --git a/tests/DatabaseTestTrait.php b/tests/DatabaseTestTrait.php index 9a0152026..d8a5c165a 100644 --- a/tests/DatabaseTestTrait.php +++ b/tests/DatabaseTestTrait.php @@ -22,7 +22,6 @@ namespace Friendica\Test; use Friendica\Database\Database; -use Friendica\Database\DBStructure; use Friendica\Test\Util\Database\StaticDatabase; /** @@ -38,10 +37,6 @@ trait DatabaseTestTrait // Start the first, outer transaction StaticDatabase::getGlobConnection()->beginTransaction(); - StaticDatabase::setTestmode(true); - - DBStructure::checkInitialValues(); - parent::setUp(); } diff --git a/tests/Util/Database/StaticDatabase.php b/tests/Util/Database/StaticDatabase.php index f2ed6c700..38466c65b 100644 --- a/tests/Util/Database/StaticDatabase.php +++ b/tests/Util/Database/StaticDatabase.php @@ -22,6 +22,7 @@ namespace Friendica\Test\Util\Database; use Friendica\Database\Database; +use Friendica\Database\DBStructure; use PDO; use PDOException; @@ -57,6 +58,10 @@ class StaticDatabase extends Database $this->connection = self::$staticConnection; $this->connected = true; + $this->setTestmode(true); + + DBStructure::checkInitialValues(); + return $this->connected; }