public function testResponseRendering() {
$this->response->body = 'Document body';
ob_start();
$this->response->render();
$result = ob_get_clean();
$this->assertEqual('Document body', $result);
$this->assertEqual(array('HTTP/1.1 200 OK'), $this->response->testHeaders);
ob_start();
echo $this->response;
$result = ob_get_clean();
$this->assertEqual('Document body', $result);
$this->assertEqual(array('HTTP/1.1 200 OK'), $this->response->testHeaders);
$this->response->body = 'Created';
$this->response->status(201);
$this->response->disableCache();
ob_start();
$this->response->render();
$result = ob_get_clean();
$this->assertEqual('Created', $result);
$headers = array (
'HTTP/1.1 201 Created',
'Expires: Mon, 26 Jul 1997 05:00:00 GMT',
'Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT',
array(
'Cache-Control: no-store, no-cache, must-revalidate',
'Cache-Control: post-check=0, pre-check=0'
),
'Pragma: no-cache'
);
$this->assertEqual($headers, $this->response->testHeaders);
}