Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUGFIX If fixture file is NULL don't cause the test framework to brea…

…k down because of it (from r100548)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105601 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 53ed23d8b63acebb09e4e733aa054712148f1da8 1 parent 94801d7
@chillu chillu authored
Showing with 13 additions and 11 deletions.
  1. +13 −11 dev/SapphireTest.php
View
24 dev/SapphireTest.php
@@ -129,17 +129,19 @@ function setUp() {
self::empty_temp_db();
- $fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);
-
- $i = 0;
- foreach($fixtureFiles as $fixtureFilePath) {
- $fixture = new YamlFixture($fixtureFilePath);
- $fixture->saveIntoDatabase();
- $this->fixtures[] = $fixture;
-
- // backwards compatibility: Load first fixture into $this->fixture
- if($i == 0) $this->fixture = $fixture;
- $i++;
+ if($fixtureFile) {
+ $fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);
+
+ $i = 0;
+ foreach($fixtureFiles as $fixtureFilePath) {
+ $fixture = new YamlFixture($fixtureFilePath);
+ $fixture->saveIntoDatabase();
+ $this->fixtures[] = $fixture;
+
+ // backwards compatibility: Load first fixture into $this->fixture
+ if($i == 0) $this->fixture = $fixture;
+ $i++;
+ }
}
$this->logInWithPermission("ADMIN");
Please sign in to comment.
Something went wrong with that request. Please try again.