ImboUnitTest\Http\Response\ResponseFormatterTest::testUsesDefaultMediaTypeInNonStrictModeWhenTheUserAgentDoesNotSupportAnyMediaTypes PHP Method

testUsesDefaultMediaTypeInNonStrictModeWhenTheUserAgentDoesNotSupportAnyMediaTypes() public method

    public function testUsesDefaultMediaTypeInNonStrictModeWhenTheUserAgentDoesNotSupportAnyMediaTypes()
    {
        $this->event->expects($this->once())->method('hasArgument')->with('noStrict')->will($this->returnValue(true));
        $requestHeaders = $this->getMock('Symfony\\Component\\HttpFoundation\\HeaderBag');
        $requestHeaders->expects($this->once())->method('get')->with('Accept', '*/*')->will($this->returnValue('text/xml'));
        $this->request->headers = $requestHeaders;
        $this->contentNegotiation->expects($this->any())->method('isAcceptable')->will($this->returnValue(false));
        $this->response->expects($this->once())->method('setVary')->with('Accept');
        $this->responseFormatter->negotiate($this->event);
        $this->assertSame('json', $this->responseFormatter->getFormatter());
    }