public function ContainerBuilderTest::testExtension

@covers Symfony\Component\DependencyInjection\ContainerBuilder::registerExtension @covers Symfony\Component\DependencyInjection\ContainerBuilder::getExtension

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testExtension() {
  $container = new ContainerBuilder();
  $container
    ->setResourceTracking(false);
  $container
    ->registerExtension($extension = new \ProjectExtension());
  $this
    ->assertTrue($container
    ->getExtension('project') === $extension, '->registerExtension() registers an extension');
  $this
    ->setExpectedException('LogicException');
  $container
    ->getExtension('no_registered');
}