8000 minor #22324 [HttpFoundation] Fix transient tests (nicolas-grekas) · symfony/symfony@f9d5ede · GitHub
[go: up one dir, main page]

Skip to content

Commit f9d5ede

Browse files
committed
minor #22324 [HttpFoundation] Fix transient tests (nicolas-grekas)
This PR was merged into the 2.8 branch. Discussion ---------- [HttpFoundation] Fix transient tests | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - We need to call `time()` when creating `DateTime` objects so that the clock-mock system can work. This fixes some newly introduced transient tests. ping @mpdude FYI Commits ------- 9f7a6bb [HttpFoundation] Fix transient tests
2 parents 0eb4d2a + 9f7a6bb commit f9d5ede

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function __construct($content = '', $status = 200, $headers = array())
204204

205205
/* RFC2616 - 14.18 says all Responses need to have a Date */
206206
if (!$this->headers->has('Date')) {
207-
$this->setDate(new \DateTime(null, new \DateTimeZone('UTC')));
207+
$this->setDate(\DateTime::createFromFormat('U', time()));
208208
}
209209
}
210210

0 commit comments

Comments
 (0)
0