Skip to content
This repository
Browse code

Add test for accept header.

Refs #2828
  • Loading branch information...
commit f6b33db02c1323c7e7fce1467724ed2a8ad85c14 1 parent d80b1ef
Mark Story authored April 29, 2012
16  lib/Cake/Test/Case/Network/CakeRequestTest.php
@@ -930,6 +930,22 @@ public function testParseAcceptWithQValue() {
930 930
 	}
931 931
 
932 932
 /**
  933
+ * Test parsing accept with a confusing accept value.
  934
+ *
  935
+ * @return void
  936
+ */
  937
+	public function testParseAcceptNoQValues() {
  938
+		$_SERVER['HTTP_ACCEPT'] = 'application/json, text/plain, */*';
  939
+
  940
+		$request = new CakeRequest('/', false);
  941
+		$result = $request->parseAccept();
  942
+		$expected = array(
  943
+			'1.0' => array('application/json', 'text/plain', '*/*'),
  944
+		);
  945
+		$this->assertEquals($expected, $result);
  946
+	}
  947
+
  948
+/**
933 949
  * testBaseUrlAndWebrootWithModRewrite method
934 950
  *
935 951
  * @return void

0 notes on commit f6b33db

Please sign in to comment.
Something went wrong with that request. Please try again.