Exemplo n.º 1
0
 public static function tearDownAfterClass()
 {
     // We need to clean up after this test case, since database will not
     // be reset by the suite it initialisation has happened once, see pull req. #234
     // Next: Suite which always prepares the db for you.
     $db = ezpTestDatabaseHelper::create(ezpTestRunner::dsn());
     ezpTestDatabaseHelper::clean($db);
     ezpTestDatabaseHelper::insertDefaultData($db);
 }
 /**
  * Sets up the database enviroment
  */
 protected function setUp()
 {
     if (ezpTestRunner::dbPerTest()) {
         $dsn = ezpTestRunner::dsn();
         $this->sharedFixture = ezpTestDatabaseHelper::create($dsn);
         if ($this->insertDefaultData === true) {
             ezpTestDatabaseHelper::insertDefaultData($this->sharedFixture);
         }
         if (count($this->sqlFiles > 0)) {
             ezpTestDatabaseHelper::insertSqlData($this->sharedFixture, $this->sqlFiles);
         }
     }
     eZDB::setInstance($this->sharedFixture);
 }