You are here

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

File

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

Class

AnalyzeServiceReferencesPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessDetectsReferencesFromInlinedDefinitions() {
  $container = new ContainerBuilder();
  $container
    ->register('a');
  $container
    ->register('b')
    ->addArgument(new Definition(null, array(
    $ref = new Reference('a'),
  )));
  $graph = $this
    ->process($container);
  $this
    ->assertCount(1, $refs = $graph
    ->getNode('a')
    ->getInEdges());
  $this
    ->assertSame($ref, $refs[0]
    ->getValue());
}