You are here

public function ContainerBuilderTest::testCreateServiceClass in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testCreateServiceClass()

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

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php, line 306

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');
}