mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-23 19:39:10 -04:00
ALPHA 3.0.2a
This commit is contained in:
@@ -126,7 +126,7 @@ class ResponseTest extends ResponseTestCase
|
||||
|
||||
public function testSetNotModified()
|
||||
{
|
||||
$response = new Response();
|
||||
$response = new Response('foo');
|
||||
$modified = $response->setNotModified();
|
||||
$this->assertObjectHasAttribute('headers', $modified);
|
||||
$this->assertObjectHasAttribute('content', $modified);
|
||||
@@ -135,6 +135,11 @@ class ResponseTest extends ResponseTestCase
|
||||
$this->assertObjectHasAttribute('statusText', $modified);
|
||||
$this->assertObjectHasAttribute('charset', $modified);
|
||||
$this->assertEquals(304, $modified->getStatusCode());
|
||||
|
||||
ob_start();
|
||||
$modified->sendContent();
|
||||
$string = ob_get_clean();
|
||||
$this->assertEmpty($string);
|
||||
}
|
||||
|
||||
public function testIsSuccessful()
|
||||
@@ -357,6 +362,11 @@ class ResponseTest extends ResponseTestCase
|
||||
$response->headers->set('Expires', -1);
|
||||
$response->expire();
|
||||
$this->assertNull($response->headers->get('Age'), '->expire() does not set the Age when the response is expired');
|
||||
|
||||
$response = new Response();
|
||||
$response->headers->set('Expires', date(DATE_RFC2822, time() + 600));
|
||||
$response->expire();
|
||||
$this->assertNull($response->headers->get('Expires'), '->expire() removes the Expires header when the response is fresh');
|
||||
}
|
||||
|
||||
public function testGetTtl()
|
||||
@@ -969,7 +979,7 @@ class ResponseTest extends ResponseTestCase
|
||||
*/
|
||||
public function ianaCodesReasonPhrasesProvider()
|
||||
{
|
||||
if (!in_array('https', stream_get_wrappers(), true)) {
|
||||
if (!\in_array('https', stream_get_wrappers(), true)) {
|
||||
$this->markTestSkipped('The "https" wrapper is not available');
|
||||
}
|
||||
|
||||
@@ -997,7 +1007,7 @@ class ResponseTest extends ResponseTestCase
|
||||
$value = $xpath->query('.//ns:value', $record)->item(0)->nodeValue;
|
||||
$description = $xpath->query('.//ns:description', $record)->item(0)->nodeValue;
|
||||
|
||||
if (in_array($description, array('Unassigned', '(Unused)'), true)) {
|
||||
if (\in_array($description, array('Unassigned', '(Unused)'), true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user