mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX If fixture file is NULL don't cause the test framework to break down because of it (from r100548)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105601 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
94801d75ff
commit
53ed23d8b6
@ -129,17 +129,19 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
|
|
||||||
self::empty_temp_db();
|
self::empty_temp_db();
|
||||||
|
|
||||||
$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);
|
if($fixtureFile) {
|
||||||
|
$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);
|
||||||
$i = 0;
|
|
||||||
foreach($fixtureFiles as $fixtureFilePath) {
|
$i = 0;
|
||||||
$fixture = new YamlFixture($fixtureFilePath);
|
foreach($fixtureFiles as $fixtureFilePath) {
|
||||||
$fixture->saveIntoDatabase();
|
$fixture = new YamlFixture($fixtureFilePath);
|
||||||
$this->fixtures[] = $fixture;
|
$fixture->saveIntoDatabase();
|
||||||
|
$this->fixtures[] = $fixture;
|
||||||
// backwards compatibility: Load first fixture into $this->fixture
|
|
||||||
if($i == 0) $this->fixture = $fixture;
|
// backwards compatibility: Load first fixture into $this->fixture
|
||||||
$i++;
|
if($i == 0) $this->fixture = $fixture;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->logInWithPermission("ADMIN");
|
$this->logInWithPermission("ADMIN");
|
||||||
|
Loading…
Reference in New Issue
Block a user