You are here

public function ResolveDefinitionTemplatesPassTest::testProcessHandlesMultipleInheritance 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/ResolveDefinitionTemplatesPassTest.php \Symfony\Component\DependencyInjection\Tests\Compiler\ResolveDefinitionTemplatesPassTest::testProcessHandlesMultipleInheritance()

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDefinitionTemplatesPassTest.php, line 120

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());
}