FrameworkExtension example

$this->assertEquals($container->getParameter('kernel.project_dir').'/config/routing.xml', $container->getParameter('router.resource'), '->registerRouterConfiguration() sets routing resource');
        $this->assertEquals('%router.resource%', $arguments[1], '->registerRouterConfiguration() sets routing resource');
        $this->assertEquals('xml', $arguments[2]['resource_type'], '->registerRouterConfiguration() sets routing resource type');

        $this->assertSame(['_locale' => 'fr|en']$container->getDefinition('routing.loader')->getArgument(2));
    }

    public function testRouterRequiresResourceOption()
    {
        $this->expectException(InvalidConfigurationException::class);
        $container = $this->createContainer();
        $loader = new FrameworkExtension();
        $loader->load([['http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true], 'router' => true]]$container);
    }

    public function testSession()
    {
        $container = $this->createContainerFromFile('full');

        $this->assertEquals('fr', $container->getParameter('kernel.default_locale'));
        $this->assertEquals('session.storage.factory.native', (string) $container->getAlias('session.storage.factory'));
        $this->assertEquals('session.handler.native_file', (string) $container->getAlias('session.handler'));

        
/** * @internal * * @covers \Shopware\Core\Installer\Installer */
class InstallerTest extends TestCase
{
    public function testBuild(): void
    {
        $container = new ContainerBuilder();
        $container->registerExtension(new FrameworkExtension());

        $installer = new Installer();
        $installer->build($container);

        static::assertSame(
            [
                'de' => 'de-DE',
                'en' => 'en-GB',
                'us' => 'en-US',
                'cs' => 'cs-CZ',
                'es' => 'es-ES',
                

#[Package('core')] class Framework extends Bundle
{
    public function getTemplatePriority(): int
    {
        return -1;
    }

    public function getContainerExtension(): Extension
    {
        return new FrameworkExtension();
    }

    /** * {@inheritdoc} */
    public function build(ContainerBuilder $container): void
    {
        $container->setParameter('locale', 'en-GB');
        $environment = (string) $container->getParameter('kernel.environment');

        $this->buildConfig($container$environment);

        

        $container->setParameter('request_listener.http_port', 80);
        $container->setParameter('request_listener.https_port', 443);

        $config = [
            'security' => [
                'providers' => ['some_provider' => ['id' => 'foo']],
                'firewalls' => ['some_firewall' => ['security' => false]],
            ],
        ];

        $ext = new FrameworkExtension();
        $ext->load(['framework' => ['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true], 'csrf_protection' => false, 'router' => ['resource' => 'dummy', 'utf8' => true]]]$container);

        $ext = new SecurityExtension();
        $ext->load($config$container);

        $pass = new AddSessionDomainConstraintPass();
        $pass->process($container);

        $container->setDefinition('.service_subscriber.fallback_container', new Definition(Container::class));
        $container->setAlias(ContainerInterface::classnew Alias('.service_subscriber.fallback_container', false));

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