mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
70bd588ba5
commit
356a0a706b
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user