Contao\CoreBundle\Test\EventListener\PrettyErrorScreenListenerTest::testBypassUponWrongRequestFormat PHP Method

testBypassUponWrongRequestFormat() public method

Tests that the listener is bypassed if the request format is not "html".
    public function testBypassUponWrongRequestFormat()
    {
        $request = new Request();
        $request->attributes->set('_format', 'json');
        $event = new GetResponseForExceptionEvent($this->mockKernel(), $request, HttpKernelInterface::MASTER_REQUEST, new InternalServerErrorHttpException('', new InsecureInstallationException()));
        /** @var PrettyErrorScreenListener|\PHPUnit_Framework_MockObject_MockObject $listener */
        $listener = $this->getMockBuilder('Contao\\CoreBundle\\EventListener\\PrettyErrorScreenListener')->disableOriginalConstructor()->setMethods(['handleException'])->getMock();
        $listener->expects($this->never())->method('handleException');
        $listener->onKernelException($event);
    }