Skip to content

Commit fafab0d

Browse files
Merge branch '6.2' into 6.3
* 6.2: cs fix [Messenger] Fix passing options set via tags to handler descriptors random_bytes length should be an int greater than 0 enforce UTC timezone in test [DependencyInjection] Fix autocasting null env values to empty string Fix executable bit Fix executable bit Readme: Replace Stack Overflow with GitHub Discussions [DoctrineBridge] Remove outdated comment [DependencyInjection] Fix annotation [SecurityBundle] Do not translate `Bearer` header’s `error_description` [String] Fix Inflector for 'status' [DependencyInjection] Fix resource tracking for lazy services [EventDispatcher] [EventDispatcher] Throw exception when listener method cannot be resolved
2 parents c81268d + 5774ae9 commit fafab0d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Tests/Caster/DateCasterTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ class DateCasterTest extends TestCase
2525
{
2626
use VarDumperTestTrait;
2727

28+
private $previousTimezone;
29+
30+
protected function setUp(): void
31+
{
32+
parent::setUp();
33+
34+
$this->previousTimezone = date_default_timezone_get();
35+
}
36+
37+
protected function tearDown(): void
38+
{
39+
parent::tearDown();
40+
41+
date_default_timezone_set($this->previousTimezone);
42+
}
43+
2844
/**
2945
* @dataProvider provideDateTimes
3046
*/
@@ -111,6 +127,8 @@ public static function provideDateTimes()
111127
*/
112128
public function testCastDateTimeNoTimezone($time, $xDate, $xInfos)
113129
{
130+
date_default_timezone_set('UTC');
131+
114132
$stub = new Stub();
115133
$date = new NoTimezoneDate($time);
116134
$cast = DateCaster::castDateTime($date, Caster::castObject($date, \DateTime::class), $stub, false, 0);

0 commit comments

Comments
 (0)