コード例 #1
0
 /**
  * Test that the down method will truncate all current fixture table data
  * and empty the fixtures array.
  *
  * @test
  * @return void
  */
 public function it_should_truncate_all_fixtures()
 {
     $this->fixture->setConfig(array('location' => __DIR__ . '/fixtures/standard'));
     $this->fixture->up();
     $this->fixture->down();
     list($userCount, $roleCount, $gameCount) = $this->getRecordCounts();
     $this->assertEmpty($this->fixture->getFixtures());
     $this->assertEquals(0, $userCount);
     $this->assertEquals(0, $roleCount);
     $this->assertEquals(0, $gameCount);
 }
コード例 #2
0
ファイル: EloquentTest.php プロジェクト: codesleeve/fixture
 /**
  * Test that extra join columns for a HABTM fixture are being populated.
  *
  * @test
  * @return void
  */
 public function itShouldPopulateFixtureJoinColumnData()
 {
     $this->fixture->setConfig(array('location' => __DIR__ . '/fixtures/orm'));
     $this->fixture->up(array('users', 'roles'));
     $this->assertEquals(1, $this->fixture->users('Travis')->roles[0]->pivot->active);
     $this->assertEquals(0, $this->fixture->users('Travis')->roles[1]->pivot->active);
 }
コード例 #3
0
ファイル: FixtureTest.php プロジェクト: codesleeve/fixture
 /**
  * Test that an an exception is thrown when trying to access a fixture that
  * does not exist
  *
  * @test
  * @expectedException Codesleeve\Fixture\Exceptions\InvalidFixtureNameException
  * @return void
  */
 public function itShouldThrowAnExceptionIfTheFixtureNameDoesNotExist()
 {
     $this->fixture->setConfig(array('location' => __DIR__ . '/fixtures/standard'));
     $this->fixture->setFixtures(array());
     $this->fixture->foo();
 }
コード例 #4
0
 /**
  * Test that an an exception is thrown when trying to access a fixture that 
  * does not exist
  *
  * @test
  * @expectedException Codesleeve\Fixture\Exceptions\InvalidFixtureNameException
  * @return void
  */
 public function it_should_throw_an_exception_if_the_fixture_name_does_not_exist()
 {
     $this->fixture->setConfig(array('location' => __DIR__ . '/fixtures/standard'));
     $this->fixture->setFixtures(array());
     $this->fixture->foo();
 }