You are here

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

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php, line 103

Class

AnalyzeServiceReferencesPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessDoesNotSaveDuplicateReferences() {
  $container = new ContainerBuilder();
  $container
    ->register('a');
  $container
    ->register('b')
    ->addArgument(new Definition(null, array(
    $ref1 = new Reference('a'),
  )))
    ->addArgument(new Definition(null, array(
    $ref2 = new Reference('a'),
  )));
  $graph = $this
    ->process($container);
  $this
    ->assertCount(2, $graph
    ->getNode('a')
    ->getInEdges());
}