You are here

public function ResolveDefinitionTemplatesPassTest::testProcess in Service Container 7

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

File

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

Class

ResolveDefinitionTemplatesPassTest

Namespace

Symfony\Component\DependencyInjection\Tests\Compiler

Code

public function testProcess() {
  $container = new ContainerBuilder();
  $container
    ->register('parent', 'foo')
    ->setArguments(array(
    'moo',
    'b',
  ))
    ->setProperty('foo', 'moo');
  $container
    ->setDefinition('child', new DefinitionDecorator('parent'))
    ->replaceArgument(0, 'a')
    ->setProperty('foo', 'bar')
    ->setClass('bar');
  $this
    ->process($container);
  $def = $container
    ->getDefinition('child');
  $this
    ->assertNotInstanceOf('Symfony\\Component\\DependencyInjection\\DefinitionDecorator', $def);
  $this
    ->assertEquals('bar', $def
    ->getClass());
  $this
    ->assertEquals(array(
    'a',
    'b',
  ), $def
    ->getArguments());
  $this
    ->assertEquals(array(
    'foo' => 'bar',
  ), $def
    ->getProperties());
}