ApiPlatform\Core\Tests\EventListener\AddFormatListenerTest::testUnsupportedAcceptHeader PHP 메소드

testUnsupportedAcceptHeader() 공개 메소드

    public function testUnsupportedAcceptHeader()
    {
        $request = new Request([], [], ['_api_resource_class' => 'Foo']);
        $request->headers->set('Accept', 'text/html, application/xhtml+xml, application/xml;q=0.9');
        $eventProphecy = $this->prophesize(GetResponseEvent::class);
        $eventProphecy->getRequest()->willReturn($request)->shouldBeCalled();
        $event = $eventProphecy->reveal();
        $listener = new AddFormatListener(new Negotiator(), ['binary' => ['application/octet-stream'], 'json' => ['application/json']]);
        $listener->onKernelRequest($event);
    }