Extends
lithium\test\Unit
Tests location headers and custom header add-ons, like 'download'.
Returns
voidSource
public function testHeaderTypes() {
$this->response->headers('download', 'report.csv');
ob_start();
$this->response->render();
ob_end_clean();
$headers = array(
'HTTP/1.1 200 OK',
'Content-Disposition: attachment; filename="report.csv"'
);
$this->assertEqual($headers, $this->response->testHeaders);
$this->response = new MockResponse();
$this->response->headers('location', '/');
ob_start();
$this->response->render();
ob_end_clean();
$headers = array('HTTP/1.1 302 Found', 'Location: /');
$this->assertEqual($headers, $this->response->testHeaders);
}