public function setUp() { $this->twig = m::mock('\\Twig_Environment'); $this->container = m::mock('Symfony\\Component\\DependencyInjection\\ContainerInterface'); $this->container->shouldReceive('get')->with('twig')->andReturn($this->twig); $this->kernel = m::mock('Symfony\\Component\\HttpKernel\\KernelInterface'); $this->kernel->shouldReceive('getName')->andReturn('app'); $this->kernel->shouldReceive('getEnvironment')->andReturn('prod'); $this->kernel->shouldReceive('isDebug')->andReturn(false); $this->kernel->shouldReceive('getContainer')->andReturn($this->container); }