Add test for accept header.

Refs #2828
This commit is contained in:
mark_story 2012-04-29 14:48:45 -04:00
parent d80b1ef7f6
commit f6b33db02c

View file

@ -929,6 +929,22 @@ class CakeRequestTest extends CakeTestCase {
$this->assertEquals($expected, $result);
}
/**
* Test parsing accept with a confusing accept value.
*
* @return void
*/
public function testParseAcceptNoQValues() {
$_SERVER['HTTP_ACCEPT'] = 'application/json, text/plain, */*';
$request = new CakeRequest('/', false);
$result = $request->parseAccept();
$expected = array(
'1.0' => array('application/json', 'text/plain', '*/*'),
);
$this->assertEquals($expected, $result);
}
/**
* testBaseUrlAndWebrootWithModRewrite method
*