public function ContainerBuilderTest::testThrowsExceptionWhenSetServiceOnAFrozenContainer

@expectedException BadMethodCallException

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testThrowsExceptionWhenSetServiceOnAFrozenContainer() {
  if (!class_exists('Symfony\\Component\\Config\\Resource\\FileResource')) {
    $this
      ->markTestSkipped('The "Config" component is not available');
  }
  $container = new ContainerBuilder();
  $container
    ->compile();
  $container
    ->set('a', new \stdClass());
}