diff --git a/cake/tests/cases/libs/cake_response.test.php b/cake/tests/cases/libs/cake_response.test.php index bc3444451..80c2a6a76 100644 --- a/cake/tests/cases/libs/cake_response.test.php +++ b/cake/tests/cases/libs/cake_response.test.php @@ -334,4 +334,19 @@ class CakeResponseTestCase extends CakeTestCase { $this->assertEquals($response->header(), $expected); } +/** +* Tests the mapType method +* +*/ + public function testMapType() { + $response = new CakeResponse(); + $this->assertEquals('wav', $response->mapType('audio/x-wav')); + $this->assertEquals('pdf', $response->mapType('application/pdf')); + $this->assertEquals('xml', $response->mapType('text/xml')); + $this->assertEquals('html', $response->mapType('*/*')); + $this->assertEquals('csv', $response->mapType('application/vnd.ms-excel')); + $expected = array('json', 'xhtml', 'css'); + $result = $response->mapType(array('application/json', 'application/xhtml+xml', 'text/css')); + $this->assertEquals($expected, $result); + } } \ No newline at end of file