You are here

public function AutoAliasServicePassTest::testProcessWithNonExistingAlias in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/Compiler/AutoAliasServicePassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\AutoAliasServicePassTest::testProcessWithNonExistingAlias()

File

vendor/symfony/dependency-injection/Tests/Compiler/AutoAliasServicePassTest.php, line 48

Class

AutoAliasServicePassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessWithNonExistingAlias() {
  $container = new ContainerBuilder();
  $container
    ->register('example', 'Symfony\\Component\\DependencyInjection\\Tests\\Compiler\\ServiceClassDefault')
    ->addTag('auto_alias', array(
    'format' => '%existing%.example',
  ));
  $container
    ->setParameter('existing', 'mysql');
  $pass = new AutoAliasServicePass();
  $pass
    ->process($container);
  $this
    ->assertEquals('Symfony\\Component\\DependencyInjection\\Tests\\Compiler\\ServiceClassDefault', $container
    ->getDefinition('example')
    ->getClass());
  $this
    ->assertInstanceOf('Symfony\\Component\\DependencyInjection\\Tests\\Compiler\\ServiceClassDefault', $container
    ->get('example'));
}