You are here

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

@expectedException \BadMethodCallException

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testThrowsExceptionWhenSetServiceOnAFrozenContainer() {
  $container = new ContainerBuilder();
  $container
    ->setResourceTracking(false);
  $container
    ->setDefinition('a', new Definition('stdClass'));
  $container
    ->compile();
  $container
    ->set('a', new \stdClass());
}