コード例 #1
0
ファイル: Loader.php プロジェクト: Vowow/AliceBundle
 /**
  * @param ProcessorChain  $processorChain
  * @param ProviderChain   $providerChain
  * @param string          $locale
  * @param int             $seed
  * @param bool            $persistOnce
  * @param LoggerInterface $logger
  */
 public function __construct(ProcessorChain $processorChain, ProviderChain $providerChain, $locale, $seed, $persistOnce, LoggerInterface $logger = null)
 {
     $this->processors = $processorChain->getProcessors();
     $options = [];
     $options['providers'] = $providerChain->getProviders();
     $options['locale'] = $locale;
     $options['seed'] = $seed;
     $options['persist_once'] = $persistOnce;
     if (null !== $logger) {
         $options['logger'] = $logger;
     }
     $this->options = $options;
 }
コード例 #2
0
 /**
  * @coversNothing
  */
 public function testGenerator()
 {
     $this->assertSame(count((new Generator())->getProviders()) + 1, count($this->providerChain->getProviders()));
     $this->assertSame('Hautelook\\AliceBundle\\Tests\\SymfonyApp\\TestBundle\\DataFixtures\\Faker\\Provider\\FooProvider', get_class($this->providerChain->getProviders()[0]), 'Expected custom Faker provider to be registered.');
 }
コード例 #3
0
ファイル: Loader.php プロジェクト: aciliainternet/AliceBundle
 /**
  * @param string        $locale
  * @param ProviderChain $providerChain
  * @param int           $seed
  * @param array         $parameters
  */
 public function __construct($locale = 'en_US', ProviderChain $providerChain, $seed = 1, array $parameters = [])
 {
     parent::__construct($locale, $providerChain->getProviders(), $seed, $parameters);
 }