You are here

public function RemoveUnusedDefinitionsPassTest::testProcess in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\RemoveUnusedDefinitionsPassTest::testProcess()

File

vendor/symfony/dependency-injection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php, line 23

Class

RemoveUnusedDefinitionsPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

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