Ejemplo n.º 1
0
 public function testShouldSetContainerOnContainerAwareFixture()
 {
     $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
     $loader = new Loader($container);
     $fixture = new ContainerAwareFixture();
     $loader->addFixture($fixture);
     $this->assertSame($container, $fixture->container);
 }
 /**
  * Load a data fixture class.
  *
  * @param Loader $loader
  * @param string $className
  */
 protected function loadFixtureClass($loader, $className)
 {
     $fixture = new $className();
     if ($loader->hasFixture($fixture)) {
         unset($fixture);
         return;
     }
     $loader->addFixture($fixture);
     if ($fixture instanceof DependentFixtureInterface) {
         foreach ($fixture->getDependencies() as $dependency) {
             $this->loadFixtureClass($loader, $dependency);
         }
     }
 }