Skip to content

Commit

Permalink
Add test for accept header.
Browse files Browse the repository at this point in the history
Refs #2828
  • Loading branch information
markstory committed Apr 29, 2012
1 parent d80b1ef commit f6b33db
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Cake/Test/Case/Network/CakeRequestTest.php
Expand Up @@ -929,6 +929,22 @@ public function testParseAcceptWithQValue() {
$this->assertEquals($expected, $result); $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 * testBaseUrlAndWebrootWithModRewrite method
* *
Expand Down

0 comments on commit f6b33db

Please sign in to comment.