ApiPlatform\Core\tests\Action\ExceptionActionTest::testActionWithUncatchableException PHP Method

testActionWithUncatchableException() public method

    public function testActionWithUncatchableException()
    {
        $serializerException = $this->prophesize(ExceptionInterface::class);
        $serializerException->willExtend(\Exception::class);
        $flattenException = FlattenException::create($serializerException->reveal());
        $serializer = $this->prophesize(SerializerInterface::class);
        $serializer->serialize($flattenException, 'jsonproblem')->willReturn();
        $exceptionAction = new ExceptionAction($serializer->reveal(), ['jsonproblem' => ['application/problem+json'], 'jsonld' => ['application/ld+json']]);
        $request = new Request();
        $request->setFormat('jsonproblem', 'application/problem+json');
        $expected = new Response('', Response::HTTP_INTERNAL_SERVER_ERROR, ['Content-Type' => 'application/problem+json; charset=utf-8', 'X-Content-Type-Options' => 'nosniff', 'X-Frame-Options' => 'deny']);
        $this->assertEquals($expected, $exceptionAction($flattenException, $request));
    }