Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  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
  Readme: Replace Stack Overflow with GitHub Discussions
  [DependencyInjection] Fix annotation
  [String] Fix Inflector for 'status'
  [EventDispatcher] [EventDispatcher] Throw exception when listener method cannot be resolved
  • Loading branch information
nicolas-grekas committed Jul 5, 2023
2 parents facbf30 + 4684507 commit 5774ae9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Tests/Caster/DateCasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ class DateCasterTest extends TestCase
{
use VarDumperTestTrait;

private $previousTimezone;

protected function setUp(): void
{
parent::setUp();

$this->previousTimezone = date_default_timezone_get();
}

protected function tearDown(): void
{
parent::tearDown();

date_default_timezone_set($this->previousTimezone);
}

/**
* @dataProvider provideDateTimes
*/
Expand Down Expand Up @@ -111,6 +127,8 @@ public static function provideDateTimes()
*/
public function testCastDateTimeNoTimezone($time, $xDate, $xInfos)
{
date_default_timezone_set('UTC');

$stub = new Stub();
$date = new NoTimezoneDate($time);
$cast = DateCaster::castDateTime($date, Caster::castObject($date, \DateTime::class), $stub, false, 0);
Expand Down

0 comments on commit 5774ae9

Please sign in to comment.