public function ContainerBuilderTest::testRegisteredButNotLoadedExtension

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testRegisteredButNotLoadedExtension() {
  if (!class_exists('Symfony\\Component\\Config\\Resource\\FileResource')) {
    $this
      ->markTestSkipped('The "Config" component is not available');
  }
  $extension = $this
    ->getMock('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface');
  $extension
    ->expects($this
    ->once())
    ->method('getAlias')
    ->will($this
    ->returnValue('project'));
  $extension
    ->expects($this
    ->never())
    ->method('load');
  $container = new ContainerBuilder();
  $container
    ->registerExtension($extension);
  $container
    ->compile();
}