Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6c882a6

Browse files
committed
Fix flaky timezone test fixture
As documented in [RunningTests], tests have to be written to be independent of any php.ini file. Without specifying the timezone, the var_dump() will make use of the default timezone that may not be the expected "UTC" timezone. This renders the test-cases flaky and will make them fail if the `date.timezone` is different from the string "UTC". Fix is to interpolate the timezone in the test fixture or to set `date.timezone` to `UTC`. [RunningTests]: docs/source/miscellaneous/running-tests.rst
1 parent 580c9e3 commit 6c882a6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎Zend/tests/inheritance/deprecation_to_exception_during_inheritance_can_be_caught.phpt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Deprecation promoted to exception during inheritance
44
<?php
55
if (getenv('SKIP_PRELOAD')) die('skip Error handler not active during preloading');
66
?>
7+
--INI--
8+
date.timezone=UTC
79
--FILE--
810
<?php
911

‎ext/date/tests/multiple_calls_date_period_iterator_current.phpt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Multiple calls to DatePeriod iterator current() leak objects
33
--FILE--
44
<?php
5-
$start = new DateTime('2018年12月31日 00:00:00');
6-
$end = new DateTime('2019年12月31日 00:00:00');
5+
$start = new DateTime('2018年12月31日 00:00:00 UTC');
6+
$end = new DateTime('2019年12月31日 00:00:00 UTC');
77

88
$interval = new DateInterval('P1M');
99
$period = new DatePeriod($start, $interval, 1);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /