Пример #1
0
 public function setUp()
 {
     MySQLHelper::resetMySQLDatabases();
     $this->dbDriver = DbGet::factory(getUnitTestDbConfig('HELPER1'));
     $this->fixtureLoader = new FixtureLoader(FixtureTestCase::getFixturesRootPath(), $this->dbDriver);
     parent::setUp();
 }
Пример #2
0
 /**
  * @covers ::factory
  */
 public function test_factory_notSameInstance()
 {
     // When
     $db1 = DbGet::factory(getUnitTestDbConfig('HELPER1'));
     $db2 = DbGet::factory(getUnitTestDbConfig('HELPER2'));
     // Then
     $this->assertNotSame($db1, $db2);
 }
 /**
  * @covers ::loadSql
  *
  * @expectedException \Exception
  * @expectedExceptionMessage Error opening fixture vfs://root/fixture.sql
  */
 public function test_loadSal_file_permissions_error()
 {
     // Given
     $vFsRoot = vfsStream::setup();
     vfsStream::newFile('fixture.sql', 00)->at($vFsRoot);
     // When
     $db = DbGet::factory(getUnitTestDbConfig('HELPER1'));
     // Then
     $fixtureLoader = new FixtureLoader($vFsRoot->url(), $db);
     $fixtureLoader->loadDbFixture('fixture.sql');
 }
Пример #4
0
 /**
  * Get database helper.
  *
  * @param string $testDbName The name of database connection details form phpunit.xml.
  *
  * @throws DatabaseException
  *
  * @return DbItf
  */
 public static function dbGetHelper($testDbName)
 {
     return DbGet::factory(self::dbGetConfig($testDbName));
 }