public function testBuildWithCompilerPass() { $pass = \Mockery::mock('Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface'); $builder = \Mockery::spy(new ContainerBuilder()); $this->plugin->shouldReceive('getCompilerPasses')->andReturn([$pass]); $this->plugin->build($builder); $builder->shouldHaveReceived('addCompilerPass')->once()->with($pass); }