You are here

public function InlineServiceDefinitionsPassTest::testProcessDoesNotInlineWhenServiceReferencesItself in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\InlineServiceDefinitionsPassTest::testProcessDoesNotInlineWhenServiceReferencesItself()

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php, line 225

Class

InlineServiceDefinitionsPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessDoesNotInlineWhenServiceReferencesItself() {
  $container = new ContainerBuilder();
  $container
    ->register('foo')
    ->setPublic(false)
    ->addMethodCall('foo', array(
    $ref = new Reference('foo'),
  ));
  $this
    ->process($container);
  $calls = $container
    ->getDefinition('foo')
    ->getMethodCalls();
  $this
    ->assertSame($ref, $calls[0][1][0]);
}