You are here

public function AnalyzeServiceReferencesPassTest::testProcessDetectsFactoryReferences 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::testProcessDetectsFactoryReferences()

File

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

Class

AnalyzeServiceReferencesPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

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());
}