public function ContainerBuilderTest::testCreateServiceArguments in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testCreateServiceArguments()
@covers Symfony\Component\DependencyInjection\ContainerBuilder::createService
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ ContainerBuilderTest.php, line 317
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
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');
}