You are here

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

File

vendor/symfony/dependency-injection/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'));
}