mirror of
https://github.com/friendica/friendica
synced 2025-04-23 11:50:12 +00:00
Fix tests
- Fix InstallerTest case - Fix native function mocking - Add returntype for Unit-Tests - Fixing ExtendedPDO test troubles - Fix wrong class inheritance path for DatabaseTestTrait.php - Fix SyslogLogger Server Exception for PHP8 - Add user/contact to database.fixture.php - Avoid invalid rollbacks for test setup in PHP8
This commit is contained in:
parent
8cab5edea9
commit
02e6dff6a0
53 changed files with 171 additions and 69 deletions
|
@ -29,23 +29,23 @@ use Friendica\Test\Util\Database\StaticDatabase;
|
|||
*/
|
||||
trait DatabaseTestTrait
|
||||
{
|
||||
protected function setUp()
|
||||
protected function setUpDb()
|
||||
{
|
||||
StaticDatabase::statConnect($_SERVER);
|
||||
// Rollbacks every DB usage (in case the test couldn't call tearDown)
|
||||
StaticDatabase::statRollback();
|
||||
// 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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue