diff --git a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php index 3f330b60aa5..340ac38943a 100644 --- a/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php @@ -197,6 +197,20 @@ public function testInitializeContentTypeWithjQueryAccept() { $this->assertEquals('json', $this->RequestHandler->ext); } +/** + * Test that RequestHandler sets $this->ext when Angular sends its wonky-ish headers. + * + * @return void + */ + public function testInitializeContentTypeWithAngularAccept() { + $_SERVER['HTTP_ACCEPT'] = 'application/json, text/plain, * / *'; + $this->assertNull($this->RequestHandler->ext); + Router::parseExtensions('json'); + + $this->RequestHandler->initialize($this->Controller); + $this->assertEquals('json', $this->RequestHandler->ext); + } + /** * Test that RequestHandler sets $this->ext when jQuery sends its wonky-ish headers * and the application is configured to handle multiple extensions