You are here

public function ResolveDefinitionTemplatesPassTest::testSetLazyOnServiceIsParent in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\ResolveDefinitionTemplatesPassTest::testSetLazyOnServiceIsParent()

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php, line 161

Class

ResolveDefinitionTemplatesPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testSetLazyOnServiceIsParent() {
  $container = new ContainerBuilder();
  $container
    ->register('parent', 'stdClass')
    ->setLazy(true);
  $container
    ->setDefinition('child1', new DefinitionDecorator('parent'));
  $this
    ->process($container);
  $this
    ->assertTrue($container
    ->getDefinition('child1')
    ->isLazy());
}