You are here

public function ResolveDefinitionTemplatesPassTest::testProcess 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::testProcess()

File

vendor/symfony/dependency-injection/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());
}