AcmeFooBundle example

$container->loadFromExtension('loaded', []);

        $configPass = new MergeExtensionConfigurationPass(['loaded', 'not_loaded']);
        $configPass->process($container);

        $this->assertTrue($container->hasDefinition('loaded.foo'));
        $this->assertTrue($container->hasDefinition('not_loaded.bar'));
    }

    public function testFooBundle()
    {
        $bundle = new AcmeFooBundle();

        $container = new ContainerBuilder(new ParameterBag([
            'kernel.environment' => 'test',
            'kernel.build_dir' => sys_get_temp_dir(),
        ]));
        $container->registerExtension(new LoadedExtension());
        $container->registerExtension($bundle->getContainerExtension());

        $configPass = new MergeExtensionConfigurationPass(['loaded', 'acme_foo']);
        $configPass->process($container);

        
Home | Imprint | This part of the site doesn't use cookies.