cakephp2-php8/cake/tests/cases/libs/cake_response.test.php
2010-07-31 12:33:02 -04:30

27 lines
No EOL
815 B
PHP

<?php
App::import('Core', array('CakeResponse', 'CakeRequest'));
class CakeRequestTestCase extends CakeTestCase {
public function testConstruct() {
$response = new CakeResponse();
$this->assertNull($response->body());
$this->assertEquals($response->encoding(), 'UTF-8');
$this->assertEquals($response->type(), 'text/html');
$this->assertEquals($response->statusCode(), 200);
$options = array(
'body' => 'This is the body',
'encoding' => 'my-custom-encoding',
'type' => 'mp3',
'status' => '203'
);
$response = new CakeResponse($options);
$this->assertEquals($response->body(), 'This is the body');
$this->assertEquals($response->encoding(), 'my-custom-encoding');
$this->assertEquals($response->type(), 'audio/mpeg');
$this->assertEquals($response->statusCode(), 203);
}
}