Extends
lithium\test\Unit
Tests that accepted content-types without a `q` value are sorted in the order they appear in
the `HTTP_ACCEPT` header.
Source
public function testAcceptTypeOrder() {
$request = new Request(array('env' => array(
'HTTP_ACCEPT' => 'application/xhtml+xml,text/html'
)));
$expected = array('application/xhtml+xml', 'text/html');
$this->assertEqual($expected, $request->accepts(true));
$request = new Request(array('env' => array(
'HTTP_USER_AGENT' => 'Safari',
'HTTP_ACCEPT' => 'application/xhtml+xml,text/html,text/plain;q=0.9'
)));
$expected = array('application/xhtml+xml', 'text/html', 'text/plain');
$this->assertEqual($expected, $request->accepts(true));
}