public function AnalyzeServiceReferencesPassTest::testProcessDetectsFactoryReferences in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\AnalyzeServiceReferencesPassTest::testProcessDetectsFactoryReferences()
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ Compiler/ AnalyzeServiceReferencesPassTest.php, line 121
Class
Namespace
Symfony\Component\DependencyInjection\Tests\CompilerCode
public function testProcessDetectsFactoryReferences() {
$container = new ContainerBuilder();
$container
->register('foo', 'stdClass')
->setFactory(array(
'stdClass',
'getInstance',
));
$container
->register('bar', 'stdClass')
->setFactory(array(
new Reference('foo'),
'getInstance',
));
$graph = $this
->process($container);
$this
->assertTrue($graph
->hasNode('foo'));
$this
->assertCount(1, $graph
->getNode('foo')
->getInEdges());
}