/** * @param Symfony\Component\HttpFoundation\Request $request * @param Symfony\Component\Debug\Exception\FlattenException $exception */ function it_renders_default_exception_response_when_templates_is_missing($request, $exception, $twig) { $twig->resolveTemplate(Argument::any())->willThrow(new \Twig_Error_Loader('')); $exception->getStatusCode()->willReturn(500); $exception->getHeaders()->willReturn([]); $request->setRequestFormat('html')->shouldBeCalled(); $response = $this($request, $exception, 'json'); $response->getStatusCode()->shouldReturn(500); }