You are here

public function ContainerBuilderTest::testAddGetCompilerPass 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::testAddGetCompilerPass()

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

File

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

Class

ContainerBuilderTest

Namespace

Symfony\Component\DependencyInjection\Tests

Code

public function testAddGetCompilerPass() {
  $builder = new ContainerBuilder();
  $builder
    ->setResourceTracking(false);
  $builderCompilerPasses = $builder
    ->getCompiler()
    ->getPassConfig()
    ->getPasses();
  $builder
    ->addCompilerPass($this
    ->getMock('Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface'));
  $this
    ->assertCount(count($builder
    ->getCompiler()
    ->getPassConfig()
    ->getPasses()) - 1, $builderCompilerPasses);
}