You are here

public function RemoveUnusedDefinitionsPassTest::testProcessRemovesUnusedDefinitionsRecursively 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/RemoveUnusedDefinitionsPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\RemoveUnusedDefinitionsPassTest::testProcessRemovesUnusedDefinitionsRecursively()

File

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

Class

RemoveUnusedDefinitionsPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

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