You are here

public function AnalyzeServiceReferencesPassTest::testProcessDetectsReferencesFromInlinedFactoryDefinitions in Zircon Profile 8

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

File

vendor/symfony/dependency-injection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php, line 81

Class

AnalyzeServiceReferencesPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessDetectsReferencesFromInlinedFactoryDefinitions() {
  $container = new ContainerBuilder();
  $container
    ->register('a');
  $factory = new Definition();
  $factory
    ->setFactory(array(
    new Reference('a'),
    'a',
  ));
  $container
    ->register('b')
    ->addArgument($factory);
  $graph = $this
    ->process($container);
  $this
    ->assertTrue($graph
    ->hasNode('a'));
  $this
    ->assertCount(1, $refs = $graph
    ->getNode('a')
    ->getInEdges());
}