예제 #1
0
 /**
  * Load a fixture's data into the database.
  * We'll also store it inside the fixtures property for easy
  * access as an array element or class property from our tests.
  *
  * @param  string $fixture
  * @return void
  */
 protected function loadFixture($fixture)
 {
     $tableName = basename($fixture, '.php');
     $records = (include $fixture);
     if (!is_array($records)) {
         throw new Exceptions\InvalidFixtureDataException("Invalid fixture: {$fixture}, please ensure this file returns an array of data.", 1);
     }
     $this->fixtures[$tableName] = $this->driver->buildRecords($tableName, $records);
 }