X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2FDatabaseTestTrait.php;h=9d46259ed1431fb1b35a894b720613a0c898444a;hb=8abf6c9dd0bf3a2f4af463f8191900931395b097;hp=d8a5c165a4f99f09042d4186180d7f5f9a3c3dc6;hpb=dc42dbb68a50fb2c60f439393eb6d1fe80b327cf;p=friendica.git diff --git a/tests/DatabaseTestTrait.php b/tests/DatabaseTestTrait.php index d8a5c165a4..9d46259ed1 100644 --- a/tests/DatabaseTestTrait.php +++ b/tests/DatabaseTestTrait.php @@ -1,6 +1,6 @@ rollBack(); // Start the first, outer transaction StaticDatabase::getGlobConnection()->beginTransaction(); - - 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"); + } } /** @@ -66,7 +68,7 @@ trait DatabaseTestTrait } if (!is_array($rows)) { - $dba->p('TRUNCATE TABLE `' . $tableName . '``'); + $dba->e('TRUNCATE TABLE `' . $tableName . '``'); continue; }