public function ContainerBuilderTest::testResolveServices

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

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php, line 325

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testResolveServices() {
  $builder = new ContainerBuilder();
  $builder
    ->register('foo', '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');
}