function testSetResponseVersion() { $_SERVER[ODataConstants::HTTPREQUEST_HEADER_METHOD] = ODataConstants::HTTP_METHOD_GET; $_SERVER[ODataConstants::HTTPREQUEST_HEADER_PROTOCOL] = ODataConstants::HTTPREQUEST_HEADER_PROTOCOL_HTTP; $_SERVER[ODataConstants::HTTPREQUEST_HEADER_HOST] = "localhost:8086"; $_SERVER[ODataConstants::HTTPREQUEST_HEADER_URI] = "/NorthWind.svc/Customers"; try { $exceptionThrown = false; $dispatcher = new dispatcher(); //Service dispatched //$dispatcher->dispatch(); $contents = ob_get_contents(); ob_end_clean(); $dispatcher->getHost()->setResponseVersion("2.0"); $headers =& $dispatcher->getHost()->getWebOperationContext()->OutgoingResponse()->getHeaders(); $this->assertEquals('2.0', $headers[ODataConstants::ODATAVERSIONHEADER]); } catch (\Exception $exception) { if (ob_get_length()) { ob_end_clean(); } $exceptionThrown = true; $this->fail("Some unexpected exception has been thrown:", $exception->getMessage()); } if (!$exceptionThrown) { $this->assertTrue(TRUE); } $dispatcher->getHost()->getWebOperationContext()->resetWebContextInternal(); }