/** * Checks if the dependency injection container can be compiled after modification * by the extension. */ public function testConfiguredContainerIsCompilable() { $builder = new ContainerBuilder(); $this->extension->load(array(), $builder); $this->setExpectedException(null); $builder->compile(); }
/** * Creates a container that is configured by this bundle. * * @return ContainerBuilder */ protected function createContainer() { $builder = new ContainerBuilder(); $extension = new WebfactoryIcuTranslationExtension(); $extension->load(array(), $builder); $builder->addCompilerPass(new DecorateTranslatorCompilerPass()); return $builder; }
/** * Creates the translator that is used for in the tests. * * @return \Symfony\Component\Translation\TranslatorInterface */ protected function createTranslator() { $builder = new ContainerBuilder(); $builder->register('translator', '\\Symfony\\Component\\Translation\\Translator')->addArgument('en'); $extension = new WebfactoryIcuTranslationExtension(); $extension->load(array(), $builder); $builder->addCompilerPass(new DecorateTranslatorCompilerPass()); $builder->compile(); $translator = $builder->get('translator'); $this->assertInstanceOf('\\Symfony\\Component\\Translation\\TranslatorInterface', $translator); return $translator; }
/** * Creates the container that is used for testing. * * @return ContainerBuilder */ protected function createContainer() { $container = new ContainerBuilder(); // Load the services that are provided by the bundle. $extension = new WebfactoryIcuTranslationExtension(); $extension->load(array(), $container); return $container; }