Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for accept header.

Refs #2828
  • Loading branch information...
commit f6b33db02c1323c7e7fce1467724ed2a8ad85c14 1 parent d80b1ef
@markstory markstory authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/Cake/Test/Case/Network/CakeRequestTest.php
View
16 lib/Cake/Test/Case/Network/CakeRequestTest.php
@@ -930,6 +930,22 @@ public function testParseAcceptWithQValue() {
}
/**
+ * 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
*
* @return void
Please sign in to comment.
Something went wrong with that request. Please try again.