X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2FDatabaseTestTrait.php;h=9d46259ed1431fb1b35a894b720613a0c898444a;hb=902bcc506f8c66b28803600d9453f35cefb750be;hp=d8a5c165a4f99f09042d4186180d7f5f9a3c3dc6;hpb=29f99c134d604f4950d6a710f0b1bca2eab0994d;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; }