You are here

public function ContainerBuilderTest::testNoExceptionWhenSetSyntheticServiceOnAFrozenContainer 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::testNoExceptionWhenSetSyntheticServiceOnAFrozenContainer()

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testNoExceptionWhenSetSyntheticServiceOnAFrozenContainer() {
  $container = new ContainerBuilder();
  $def = new Definition('stdClass');
  $def
    ->setSynthetic(true);
  $container
    ->setDefinition('a', $def);
  $container
    ->compile();
  $container
    ->set('a', $a = new \stdClass());
  $this
    ->assertEquals($a, $container
    ->get('a'));
}