Browse Source

Merge pull request #13928 from othercorey/responsetest-now

Fixed testWithModified() using different 'now' for comparison
Mark Story 6 years ago
parent
commit
3e1ca6f04b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tests/TestCase/Http/ResponseTest.php

+ 2 - 2
tests/TestCase/Http/ResponseTest.php

@@ -1089,11 +1089,11 @@ class ResponseTest extends TestCase
 
         $now = time();
         $new = $response->withModified($now);
-        $this->assertEquals(gmdate($format) . ' GMT', $new->getHeaderLine('Last-Modified'));
+        $this->assertEquals(gmdate($format, $now) . ' GMT', $new->getHeaderLine('Last-Modified'));
 
         $now = new \DateTimeImmutable();
         $new = $response->withModified($now);
-        $this->assertEquals(gmdate($format) . ' GMT', $new->getHeaderLine('Last-Modified'));
+        $this->assertEquals(gmdate($format, $now->getTimestamp()) . ' GMT', $new->getHeaderLine('Last-Modified'));
 
         $time = new \DateTime('+1 day', new \DateTimeZone('UTC'));
         $new = $response->withModified('+1 day');