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