Skip to content

Commit

Permalink
[DependencyInjection] fixed private services removal when used as con…
Browse files Browse the repository at this point in the history
…figurators (closes #3758)
  • Loading branch information
fabpot committed May 7, 2012
1 parent 6f6ee95 commit 906f6f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Expand Up @@ -74,6 +74,9 @@ public function process(ContainerBuilder $container)
if (!$this->onlyConstructorArguments) {
$this->processArguments($definition->getMethodCalls());
$this->processArguments($definition->getProperties());
if ($definition->getConfigurator()) {
$this->processArguments(array($definition->getConfigurator()));
}
}
}

Expand Down
Expand Up @@ -45,12 +45,19 @@ public function testProcess()
->setProperty('foo', $ref5 = new Reference('b'))
;

$e = $container
->register('e')
->setConfigurator(array($ref6 = new Reference('b'), 'methodName'))
;

$graph = $this->process($container);

$this->assertEquals(3, count($edges = $graph->getNode('b')->getInEdges()));
$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());
}

public function testProcessDetectsReferencesFromInlinedDefinitions()
Expand Down

0 comments on commit 906f6f6

Please sign in to comment.