public function ContainerBuilderTest::testThrowsExceptionWhenAddServiceOnAFrozenContainer

@expectedException BadMethodCallException

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testThrowsExceptionWhenAddServiceOnAFrozenContainer() {
  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());
}