public function ContainerBuilderTest::testResolveServices in Service Container 7
Same name and namespace in other branches
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testResolveServices()
@covers Symfony\Component\DependencyInjection\ContainerBuilder::resolveServices
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Tests/ ContainerBuilderTest.php, line 440
Class
Namespace
Symfony\Component\DependencyInjection\TestsCode
public function testResolveServices() {
$builder = new ContainerBuilder();
$builder
->register('foo', 'Bar\\FooClass');
$this
->assertEquals($builder
->get('foo'), $builder
->resolveServices(new Reference('foo')), '->resolveServices() resolves service references to service instances');
$this
->assertEquals(array(
'foo' => array(
'foo',
$builder
->get('foo'),
),
), $builder
->resolveServices(array(
'foo' => array(
'foo',
new Reference('foo'),
),
)), '->resolveServices() resolves service references to service instances in nested arrays');
$this
->assertEquals($builder
->get('foo'), $builder
->resolveServices(new Expression('service("foo")')), '->resolveServices() resolves expressions');
}