You are here

public function ContainerBuilderTest::testRegisteredButNotLoadedExtension in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php \Symfony\Component\DependencyInjection\Tests\ContainerBuilderTest::testRegisteredButNotLoadedExtension()

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testRegisteredButNotLoadedExtension() {
  $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
    ->setResourceTracking(false);
  $container
    ->registerExtension($extension);
  $container
    ->compile();
}