You are here

public function ContainerBuilderTest::testCreateServiceArguments in Zircon Profile 8

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

@covers Symfony\Component\DependencyInjection\ContainerBuilder::createService

File

vendor/symfony/dependency-injection/Tests/ContainerBuilderTest.php, line 317

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testCreateServiceArguments() {
  $builder = new ContainerBuilder();
  $builder
    ->register('bar', 'stdClass');
  $builder
    ->register('foo1', 'Bar\\FooClass')
    ->addArgument(array(
    'foo' => '%value%',
    '%value%' => 'foo',
    new Reference('bar'),
    '%%unescape_it%%',
  ));
  $builder
    ->setParameter('value', 'bar');
  $this
    ->assertEquals(array(
    'foo' => 'bar',
    'bar' => 'foo',
    $builder
      ->get('bar'),
    '%unescape_it%',
  ), $builder
    ->get('foo1')->arguments, '->createService() replaces parameters and service references in the arguments provided by the service definition');
}