You are here

public function IntegrationTest::testProcessInlinesReferencesToAliases in Service Container 7.2

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

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php, line 62

Class

IntegrationTest
This class tests the integration of the different compiler passes.

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessInlinesReferencesToAliases() {
  $container = new ContainerBuilder();
  $container
    ->setResourceTracking(false);
  $a = $container
    ->register('a', '\\stdClass')
    ->addArgument(new Reference('b'));
  $container
    ->setAlias('b', new Alias('c', false));
  $c = $container
    ->register('c', '\\stdClass')
    ->setPublic(false);
  $container
    ->compile();
  $this
    ->assertTrue($container
    ->hasDefinition('a'));
  $arguments = $a
    ->getArguments();
  $this
    ->assertSame($c, $arguments[0]);
  $this
    ->assertFalse($container
    ->hasAlias('b'));
  $this
    ->assertFalse($container
    ->hasDefinition('c'));
}