You are here

public function InlineServiceDefinitionsPassTest::testProcessInlinesPrivateFactoryReference 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::testProcessInlinesPrivateFactoryReference()

File

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

Class

InlineServiceDefinitionsPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessInlinesPrivateFactoryReference() {
  $container = new ContainerBuilder();
  $container
    ->register('a')
    ->setPublic(false);
  $b = $container
    ->register('b')
    ->setPublic(false)
    ->setFactory(array(
    new Reference('a'),
    'a',
  ));
  $container
    ->register('foo')
    ->setArguments(array(
    $ref = new Reference('b'),
  ));
  $this
    ->process($container);
  $inlinedArguments = $container
    ->getDefinition('foo')
    ->getArguments();
  $this
    ->assertSame($b, $inlinedArguments[0]);
}