BUGFIX: Fixed Yaml fixtures for SapphireTest

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60388 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-08-11 05:16:08 +00:00
parent 70bd588ba5
commit 356a0a706b
2 changed files with 5 additions and 4 deletions

View File

@ -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);
}
/**

View File

@ -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);
}
/**