X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2FDatabaseTestTrait.php;h=9d46259ed1431fb1b35a894b720613a0c898444a;hb=f00792d370cfbf1d52b37e3eed7e80e682df9d8a;hp=9922d7313f9fda7d2ca16486fb59d83fd47c009c;hpb=434ce00d19d54beaf9dfc09dbd2beac16c6460ca;p=friendica.git diff --git a/tests/DatabaseTestTrait.php b/tests/DatabaseTestTrait.php index 9922d7313f..9d46259ed1 100644 --- a/tests/DatabaseTestTrait.php +++ b/tests/DatabaseTestTrait.php @@ -1,6 +1,6 @@ rollBack(); // Start the first, outer transaction StaticDatabase::getGlobConnection()->beginTransaction(); - - $this->dba->setTestmode(true); - - DBStructure::checkInitialValues(); - - parent::setUp(); } - protected function tearDown() + protected function tearDownDb() { - // Rollbacks every DB usage so we don't commit anything into the DB - StaticDatabase::statRollback(); - - parent::tearDown(); + try { + // Rollbacks every DB usage so we don't commit anything into the DB + StaticDatabase::statRollback(); + } catch (\PDOException $exception) { + print_r("Found already rolled back transaction"); + } } /** @@ -71,7 +68,7 @@ trait DatabaseTestTrait } if (!is_array($rows)) { - $dba->p('TRUNCATE TABLE `' . $tableName . '``'); + $dba->e('TRUNCATE TABLE `' . $tableName . '``'); continue; }