mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding test case for CakeResponse::mapType()
This commit is contained in:
parent
7e1426e743
commit
4a8e44b419
1 changed files with 15 additions and 0 deletions
|
@ -334,4 +334,19 @@ class CakeResponseTestCase extends CakeTestCase {
|
||||||
$this->assertEquals($response->header(), $expected);
|
$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);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue