public function setUp() { MySQLHelper::resetMySQLDatabases(); $this->dbDriver = DbGet::factory(getUnitTestDbConfig('HELPER1')); $this->fixtureLoader = new FixtureLoader(FixtureTestCase::getFixturesRootPath(), $this->dbDriver); parent::setUp(); }
/** * @covers ::getFixtureRawData */ public function test_getFixtureRawData() { // When $gotData = FixtureTestCase::getFixtureRawData('test5.sql'); // Then $this->assertSame("-- This is a comment\nINSERT INTO `test2` (`id`, `col2`) VALUES (NULL, '500');\n", $gotData); }
/** * @covers ::decode * * @expectedException \Kicaj\Test\Helper\Loader\FixtureLoaderException * @expectedExceptionMessage Unknown error */ public function test_decode_unknown_error() { // Given $fixtureLoader = new FixtureLoader(FixtureTestCase::getFixturesRootPath()); _WhatJsonLastError::$jsonLastErrorReturn = 10000; // Then $json = '{"does not matter what it is here": 1}'; $fixtureLoader->decode($json); }
/** * @throws \Exception */ public function setUp() { $this->fixturesRootPath = getFixturesRootPath(); $this->fixtureLoader = new FixtureLoader(FixtureTestCase::getFixturesRootPath()); }
/** * Get database fixture loader. * * @param string $testDbName The name of database connection details form phpunit.xml. * * @throws DatabaseException * * @return FixtureLoader */ public static function dbGetFixtureLoader($testDbName = '') { $db = $testDbName ? self::dbGetHelper($testDbName) : null; return parent::getFixtureLoader($db); }