You are here

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

File

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

Class

InlineServiceDefinitionsPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessInlinesOnlyIfSameScope() {
  $container = new ContainerBuilder();
  $container
    ->addScope(new Scope('foo'));
  $a = $container
    ->register('a')
    ->setPublic(false)
    ->setScope('foo');
  $b = $container
    ->register('b')
    ->addArgument(new Reference('a'));
  $this
    ->process($container);
  $arguments = $b
    ->getArguments();
  $this
    ->assertEquals(new Reference('a'), $arguments[0]);
  $this
    ->assertTrue($container
    ->hasDefinition('a'));
}