diff --git a/core/model/YamlFixture.php b/core/model/YamlFixture.php index fa8f8684e..fee96d583 100644 --- a/core/model/YamlFixture.php +++ b/core/model/YamlFixture.php @@ -112,7 +112,8 @@ class YamlFixture extends Object { * @param $identifier The identifier string, as provided in your fixture file */ public function objFromFixture($className, $identifier) { - return DataObject::get_by_id($className, $this->idFromFixture($className, $identifier)); + $id = $this->idFromFixture($className, $identifier); + if($id) return DataObject::get_by_id($className, $id); } /** diff --git a/dev/SapphireTest.php b/dev/SapphireTest.php index 6c98f3c90..bdbb45115 100644 --- a/dev/SapphireTest.php +++ b/dev/SapphireTest.php @@ -73,7 +73,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase { * @param $identifier The identifier string, as provided in your fixture file */ protected function idFromFixture($className, $identifier) { - return $this->fixtureDictionary[$className][$identifier]; + return $this->fixture->idFromFixture($className, $identifier); } /** @@ -81,7 +81,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase { * @return A map of fixture-identifier => object-id */ protected function allFixtureIDs($className) { - return $this->fixtureDictionary[$className]; + return $this->fixture->allFixtureIDs($className); } /** @@ -90,7 +90,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase { * @param $identifier The identifier string, as provided in your fixture file */ protected function objFromFixture($className, $identifier) { - return DataObject::get_by_id($className, $this->idFromFixture($className, $identifier)); + return $this->fixture->objFromFixture($className, $identifier); } /**