ApiPlatform\Core\Tests\EventListener\AddFormatListenerTest::testUnsupportedRequestFormat PHP Method

testUnsupportedRequestFormat() public method

    public function testUnsupportedRequestFormat()
    {
        $request = new Request([], [], ['_api_resource_class' => 'Foo']);
        $request->setRequestFormat('xml');
        $eventProphecy = $this->prophesize(GetResponseEvent::class);
        $eventProphecy->getRequest()->willReturn($request)->shouldBeCalled();
        $event = $eventProphecy->reveal();
        $listener = new AddFormatListener(new Negotiator(), ['json' => ['application/json']]);
        $listener->onKernelRequest($event);
        $this->assertSame('json', $request->getRequestFormat());
    }