public function ContainerBuilderTest::testAddGetCompilerPass

@covers Symfony\Component\DependencyInjection\ContainerBuilder::addCompilerPass @covers Symfony\Component\DependencyInjection\ContainerBuilder::getCompilerPassConfig

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testAddGetCompilerPass() {
  if (!class_exists('Symfony\\Component\\Config\\Resource\\FileResource')) {
    $this
      ->markTestSkipped('The "Config" component is not available');
  }
  $builder = new ContainerBuilder();
  $builderCompilerPasses = $builder
    ->getCompiler()
    ->getPassConfig()
    ->getPasses();
  $builder
    ->addCompilerPass($this
    ->getMock('Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface'));
  $this
    ->assertEquals(sizeof($builderCompilerPasses) + 1, sizeof($builder
    ->getCompiler()
    ->getPassConfig()
    ->getPasses()));
}