You are here

public function ResolveDefinitionTemplatesPassTest::testProcessHandlesMultipleInheritance in Zircon Profile 8

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

File

vendor/symfony/dependency-injection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php, line 139

Class

ResolveDefinitionTemplatesPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcessHandlesMultipleInheritance() {
  $container = new ContainerBuilder();
  $container
    ->register('parent', 'foo')
    ->setArguments(array(
    'foo',
    'bar',
    'c',
  ));
  $container
    ->setDefinition('child2', new DefinitionDecorator('child1'))
    ->replaceArgument(1, 'b');
  $container
    ->setDefinition('child1', new DefinitionDecorator('parent'))
    ->replaceArgument(0, 'a');
  $this
    ->process($container);
  $def = $container
    ->getDefinition('child2');
  $this
    ->assertEquals(array(
    'a',
    'b',
    'c',
  ), $def
    ->getArguments());
  $this
    ->assertEquals('foo', $def
    ->getClass());
}