getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); $container ->expects($this->at(0)) ->method('addCompilerPass') ->with($this->isInstanceOf($passes[0][0]), $passes[0][1]); $container ->expects($this->at(1)) ->method('addCompilerPass') ->with($this->isInstanceOf($passes[1][0])); $bundle = new FOSElasticaBundle(); $bundle->build($container); } }