Elcodi\Bundle\TestCommonBundle\Functional\WebTestCase::loadFixtures PHP 메소드

loadFixtures() 보호된 정적인 메소드

This method is only called if create Schema is set to true Only load fixtures if loadFixtures() is set to true. All other methods will be loaded if this one is loaded. Otherwise, will return.
protected static loadFixtures ( )
    protected static function loadFixtures()
    {
        if (!static::hasFixturesBundles()) {
            return;
        }
        $bundles = static::$kernel->getBundles();
        $fixturesBundles = static::loadFixturesBundles();
        if (!empty($fixturesBundles)) {
            $formattedBundles = array_map(function ($bundle) use($bundles) {
                return $bundles[$bundle]->getPath() . '/DataFixtures/ORM/';
            }, $fixturesBundles);
            static::$application->run(new ArrayInput(['command' => 'doctrine:fixtures:load', '--no-interaction' => true, '--fixtures' => $formattedBundles, '--quiet' => true]));
        }
    }

Usage Example

 /**
  * load fixtures method
  *
  * This method is only called if create Schema is set to true
  *
  * Only load fixtures if loadFixtures() is set to true.
  * All other methods will be loaded if this one is loaded.
  *
  * Otherwise, will return.
  *
  * @return $this Self object
  */
 protected function loadFixtures()
 {
     parent::loadFixtures();
     self::$application->run(new ArrayInput(['command' => 'elcodi:plugins:load', '--no-interaction' => true, '--quiet' => true]));
 }