Permalink
Browse files

Fix for duplication of fixtures in Loader when getFixtures() is calle…

…d more than once.
  • Loading branch information...
1 parent 181b71e commit 7e943a5429e9036ee8cc8b8445420522830edafe Lars Janssen committed Oct 31, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Doctrine/Common/DataFixtures/Loader.php
@@ -41,7 +41,7 @@ class Loader
*
* @var array
*/
- private $orderedFixtures;
+ private $orderedFixtures = array();
/**
* Determines if we must order fixtures by number
@@ -151,6 +151,8 @@ public function addFixture(FixtureInterface $fixture)
*/
public function getFixtures()
{
+ $this->orderedFixtures = array();
+
if ($this->orderFixturesByNumber) {
$this->orderFixturesByNumber();
}
@@ -297,7 +299,7 @@ private function orderFixturesByDependencies()
}
}
- $this->orderedFixtures = is_array($this->orderedFixtures) ? array_merge($this->orderedFixtures, $orderedFixtures) : $orderedFixtures;
+ $this->orderedFixtures = array_merge($this->orderedFixtures, $orderedFixtures);
}
private function validateDependencies($dependenciesClasses)

0 comments on commit 7e943a5

Please sign in to comment.