ApiPlatform\Core\Tests\EventListener\ExceptionListenerTest::testDoNothingWhenHtmlRequested PHP Method

testDoNothingWhenHtmlRequested() public method

    public function testDoNothingWhenHtmlRequested()
    {
        $request = new Request([], [], ['_api_respond' => true]);
        $request->setRequestFormat('html');
        $eventProphecy = $this->prophesize(GetResponseForExceptionEvent::class);
        $eventProphecy->getRequest()->willReturn($request)->shouldBeCalled();
        $listener = new ExceptionListener('foo:bar');
        $listener->onKernelException($eventProphecy->reveal());
    }