public function ContainerBuilderTest::testCreateServiceClass

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

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testCreateServiceClass() {
  $builder = new ContainerBuilder();
  $builder
    ->register('foo1', '%class%');
  $builder
    ->setParameter('class', 'stdClass');
  $this
    ->assertInstanceOf('\\stdClass', $builder
    ->get('foo1'), '->createService() replaces parameters in the class provided by the service definition');
}