Symfony_DI_PhpDumper_Test_Frozen_No_Aliases example

$this->assertSame($foo$container->get('alias_for_alias'));
    }

    public function testFrozenContainerWithoutAliases()
    {
        $container = new ContainerBuilder();
        $container->compile();

        $dumper = new PhpDumper($container);
        eval('?>'.$dumper->dump(['class' => 'Symfony_DI_PhpDumper_Test_Frozen_No_Aliases']));

        $container = new \Symfony_DI_PhpDumper_Test_Frozen_No_Aliases();
        $this->assertFalse($container->has('foo'));
    }

    public function testOverrideServiceWhenUsingADumpedContainer()
    {
        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage('The "decorator_service" service is already initialized, you cannot replace it.');
        require_once self::$fixturesPath.'/php/services9_compiled.php';

        $container = new \ProjectServiceContainer();
        $container->get('decorator_service');
        
Home | Imprint | This part of the site doesn't use cookies.