|
|
@ -164,7 +164,7 @@ class ResponseTest extends TestCase
|
|
|
|
$response->cache(false);
|
|
|
|
$response->cache(false);
|
|
|
|
$this->assertEquals([
|
|
|
|
$this->assertEquals([
|
|
|
|
'Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT',
|
|
|
|
'Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT',
|
|
|
|
'Cache-Control' => 'no-store, no-cache, must-revalidate',
|
|
|
|
'Cache-Control' => 'no-store, no-cache, must-revalidate, max-age=0',
|
|
|
|
'Pragma' => 'no-cache'
|
|
|
|
'Pragma' => 'no-cache'
|
|
|
|
], $response->headers());
|
|
|
|
], $response->headers());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -235,8 +235,8 @@ class ResponseTest extends TestCase
|
|
|
|
$this->assertTrue($response->sent());
|
|
|
|
$this->assertTrue($response->sent());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function testSendWithNoHeadersSent()
|
|
|
|
public function testSendWithNoHeadersSent()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$response = new class extends Response {
|
|
|
|
$response = new class extends Response {
|
|
|
|
protected $test_sent_headers = [];
|
|
|
|
protected $test_sent_headers = [];
|
|
|
|
|
|
|
|
|
|
|
@ -251,16 +251,16 @@ class ResponseTest extends TestCase
|
|
|
|
return $this->test_sent_headers;
|
|
|
|
return $this->test_sent_headers;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function headersSent(): bool
|
|
|
|
public function headersSent(): bool
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$response->header('Content-Type', 'text/html');
|
|
|
|
$response->header('Content-Type', 'text/html');
|
|
|
|
$response->header('X-Test', 'test');
|
|
|
|
$response->header('X-Test', 'test');
|
|
|
|
$response->write('Something');
|
|
|
|
$response->write('Something');
|
|
|
|
|
|
|
|
|
|
|
|
$this->expectOutputString('Something');
|
|
|
|
$this->expectOutputString('Something');
|
|
|
|
|
|
|
|
|
|
|
|
$response->send();
|
|
|
|
$response->send();
|
|
|
|
$sent_headers = $response->getSentHeaders();
|
|
|
|
$sent_headers = $response->getSentHeaders();
|
|
|
@ -268,9 +268,9 @@ class ResponseTest extends TestCase
|
|
|
|
'HTTP/1.1 200 OK',
|
|
|
|
'HTTP/1.1 200 OK',
|
|
|
|
'Content-Type: text/html',
|
|
|
|
'Content-Type: text/html',
|
|
|
|
'X-Test: test',
|
|
|
|
'X-Test: test',
|
|
|
|
'Expires: Mon, 26 Jul 1997 05:00:00 GMT',
|
|
|
|
'Expires: Mon, 26 Jul 1997 05:00:00 GMT',
|
|
|
|
'Cache-Control: no-store, no-cache, must-revalidate',
|
|
|
|
'Cache-Control: no-store, no-cache, must-revalidate, max-age=0',
|
|
|
|
'Pragma: no-cache',
|
|
|
|
'Pragma: no-cache',
|
|
|
|
'Content-Length: 9'
|
|
|
|
'Content-Length: 9'
|
|
|
|
], $sent_headers);
|
|
|
|
], $sent_headers);
|
|
|
|
}
|
|
|
|
}
|
|
|
|