You are here

public function InlineServiceDefinitionsPassTest::testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinition in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/Compiler/InlineServiceDefinitionsPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\InlineServiceDefinitionsPassTest::testProcessInlinesIfMultipleReferencesButAllFromTheSameDefinition()

File

vendor/symfony/dependency-injection/Tests/Compiler/InlineServiceDefinitionsPassTest.php, line 93

Class

InlineServiceDefinitionsPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

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