1
1
Fork 0
friendica_2019-12_sharedHos.../tests/DatabaseTest.php
Philipp Holzer b08ac3c0a7
Remove Phpunit/Dbunit
- Introduce own Yaml-to-SQL class
- Introduce new way of MySQL-DB-tests (per rollback)
- Remove dependency phpunit/dbunit
- Introduce new dev-dependency for YAML-ready (Symfony YAML reader)
2019-07-28 17:40:42 +02:00

34 lines
693 B
PHP

<?php
/**
* DatabaseTest class.
*/
namespace Friendica\Test;
use Friendica\Test\Util\Database\StaticDatabase;
/**
* Abstract class used by tests that need a database.
*/
abstract class DatabaseTest extends MockedTest
{
protected function setUp()
{
parent::setUp();
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();
}
protected function tearDown()
{
// Rollbacks every DB usage so we don't commit anything into the DB
StaticDatabase::statRollback();
parent::tearDown();
}
}