You are here

public function RemoveUnusedDefinitionsPassTest::testProcessWorksWithInlinedDefinitions in Service Container 7.2

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

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php, line 65

Class

RemoveUnusedDefinitionsPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessWorksWithInlinedDefinitions() {
  $container = new ContainerBuilder();
  $container
    ->register('foo')
    ->setPublic(false);
  $container
    ->register('bar')
    ->setArguments(array(
    new Definition(null, array(
      new Reference('foo'),
    )),
  ));
  $this
    ->process($container);
  $this
    ->assertTrue($container
    ->hasDefinition('foo'));
  $this
    ->assertTrue($container
    ->hasDefinition('bar'));
}