public function AnalyzeServiceReferencesPassTest::testProcess in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dependency-injection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\AnalyzeServiceReferencesPassTest::testProcess()
File
- vendor/
symfony/ dependency-injection/ Tests/ Compiler/ AnalyzeServiceReferencesPassTest.php, line 22
Class
Namespace
Symfony\Component\DependencyInjection\Tests\CompilerCode
public function testProcess() {
$container = new ContainerBuilder();
$a = $container
->register('a')
->addArgument($ref1 = new Reference('b'));
$b = $container
->register('b')
->addMethodCall('setA', array(
$ref2 = new Reference('a'),
));
$c = $container
->register('c')
->addArgument($ref3 = new Reference('a'))
->addArgument($ref4 = new Reference('b'));
$d = $container
->register('d')
->setProperty('foo', $ref5 = new Reference('b'));
$e = $container
->register('e')
->setConfigurator(array(
$ref6 = new Reference('b'),
'methodName',
));
$graph = $this
->process($container);
$this
->assertCount(4, $edges = $graph
->getNode('b')
->getInEdges());
$this
->assertSame($ref1, $edges[0]
->getValue());
$this
->assertSame($ref4, $edges[1]
->getValue());
$this
->assertSame($ref5, $edges[2]
->getValue());
$this
->assertSame($ref6, $edges[3]
->getValue());
}