public function InlineServiceDefinitionsPassTest::testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinition in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\InlineServiceDefinitionsPassTest::testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinition()
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ Compiler/ InlineServiceDefinitionsPassTest.php, line 93
Class
Namespace
Symfony\Component\DependencyInjection\Tests\CompilerCode
public function testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinition() {
$container = new ContainerBuilder();
$a = $container
->register('a')
->setPublic(false);
$b = $container
->register('b')
->addArgument(new Reference('a'))
->addArgument(new Definition(null, array(
new Reference('a'),
)));
$this
->process($container);
$arguments = $b
->getArguments();
$this
->assertSame($a, $arguments[0]);
$inlinedArguments = $arguments[1]
->getArguments();
$this
->assertSame($a, $inlinedArguments[0]);
}