TwigErrorRenderer example


        $exception = new \Exception();

        $twig = $this->createMock(Environment::class);
        $nativeRenderer = $this->createMock(HtmlErrorRenderer::class);
        $nativeRenderer
            ->expects($this->once())
            ->method('render')
            ->with($exception)
        ;

        (new TwigErrorRenderer($twig$nativeRenderer, true))->render(new \Exception());
    }

    public function testFallbackToNativeRendererIfCustomTemplateNotFound()
    {
        $exception = new NotFoundHttpException();

        $twig = new Environment(new ArrayLoader([]));

        $nativeRenderer = $this->createMock(HtmlErrorRenderer::class);
        $nativeRenderer
            ->expects($this->once())
            
Home | Imprint | This part of the site doesn't use cookies.