/**
  * @param array $config
  *
  * @return ContainerBuilder
  */
 private function getContainer(array $config)
 {
     $container = new ContainerBuilder();
     $extension = new KGzochaSearcherExtension();
     $extension->load($config, $container);
     return $container;
 }
 /**
  * @param array $config
  *
  * @return ContainerBuilder
  */
 private function getContainer(array $config)
 {
     $container = new ContainerBuilder();
     $extension = new KGzochaSearcherExtension();
     $extension->load($config, $container);
     $container->addCompilerPass(new SearchingContextCompilerPass(new DefinitionBuilder(new ParametersValidator()), 'k_gzocha_searcher'));
     return $container;
 }
 /**
  * @param array $config
  *
  * @return ContainerBuilder
  */
 private function getContainer(array $config)
 {
     $container = new ContainerBuilder();
     $extension = new KGzochaSearcherExtension();
     $extension->load($config, $container);
     $definitionBuilder = new DefinitionBuilder(new ParametersValidator());
     $prefix = 'k_gzocha_searcher';
     $container->addCompilerPass(new TransformerCompilerPass($definitionBuilder, $prefix));
     $container->addCompilerPass(new CellCollectionCompilerPass($definitionBuilder, $prefix));
     $container->addCompilerPass(new ChainSearchCompilerPass($definitionBuilder, $prefix));
     $container->setDefinition('k_gzocha_searcher.people.searcher', new Definition('\\KGzocha\\Bundle\\SearcherBundle\\Test\\DependencyInjection\\SearcherStub'));
     $container->setDefinition('k_gzocha_searcher.log.searcher', new Definition('\\KGzocha\\Bundle\\SearcherBundle\\Test\\DependencyInjection\\SearcherStub'));
     $container->setDefinition('transformer_service', new Definition('\\KGzocha\\Bundle\\SearcherBundle\\Test\\DependencyInjection\\TransformerStub'));
     $container->setDefinition('cell_service', new Definition('\\KGzocha\\Bundle\\SearcherBundle\\Test\\DependencyInjection\\CellStub'));
     return $container;
 }
 public function testSuccessPathWithChains()
 {
     $container = new ContainerBuilder();
     $container->setDefinition('my_context', new Definition('\\KGzocha\\Bundle\\SearcherBundle\\Test\\DependencyInjection\\SearchingContextStub', [true]));
     $container->setDefinition('my_transformer_service', new Definition('\\KGzocha\\Bundle\\SearcherBundle\\Test\\DependencyInjection\\TransformerStub'));
     $extension = new KGzochaSearcherExtension();
     $extension->load($this->getMinimalConfigWithChains(), $container);
     $this->addCompilerPasses($container);
     $container->compile();
     $this->assertTrue($container->hasDefinition('k_gzocha_searcher.chains.people_log.searcher'));
     $this->assertTrue($container->hasDefinition('k_gzocha_searcher.chains.people_log.transformer.people_id_to_log_id'));
     $this->assertTrue($container->hasDefinition('k_gzocha_searcher.chains.people_log.cell.people_cell'));
     $this->assertTrue($container->hasDefinition('k_gzocha_searcher.chains.people_log.cell.log_cell'));
     /** @var ChainSearch $searcher */
     $searcher = $container->get('k_gzocha_searcher.chains.people_log.searcher');
     $this->assertInstanceOf('\\KGzocha\\Searcher\\Chain\\ChainSearch', $searcher);
     $this->assertInstanceOf('\\KGzocha\\Bundle\\SearcherBundle\\Test\\DependencyInjection\\TransformerStub', $container->get('k_gzocha_searcher.chains.people_log.transformer.my_transformer'));
 }
 /**
  * @param array $config
  *
  * @return ContainerBuilder
  */
 private function getContainer(array $config)
 {
     $container = new ContainerBuilder();
     $extension = new KGzochaSearcherExtension();
     $extension->load($config, $container);
     $container->addCompilerPass(new CriteriaBuilderCollectionCompilerPass(new DefinitionBuilder(new ParametersValidator()), 'k_gzocha_searcher'));
     $container->addCompilerPass(new SearchingContextCompilerPass(new DefinitionBuilder(new ParametersValidator()), 'k_gzocha_searcher'));
     $container->setDefinition('my_context', new Definition('\\KGzocha\\Bundle\\SearcherBundle\\Test\\DependencyInjection\\SearchingContextStub'));
     return $container;
 }