コード例 #1
0
 /**
  * @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);
 }
コード例 #2
0
 /**
  * @covers ::setUp
  */
 public function test_setUp()
 {
     // Given
     $this->assertSame(1, $this->dbDriver->dbCountTableRows('test1'));
     $this->assertSame(2, $this->dbDriver->dbCountTableRows('test2'));
     // When
     $this->fixtureLoader->loadDbFixture('test4.sql');
     // Then
     $this->assertSame(1, $this->dbDriver->dbCountTableRows('test1'));
     $this->assertSame(4, $this->dbDriver->dbCountTableRows('test2'));
 }
コード例 #3
0
 /**
  * @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
     $fixtureLoader = new FixtureLoader($vFsRoot->url());
     // Then
     $fixtureLoader->getFixtureData('fixture.sql');
 }
コード例 #4
0
 /**
  * @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');
 }