mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/13216] Use gmdate() instead of date() in datetime tests
PHPBB3-13216
This commit is contained in:
parent
a5830fe0d5
commit
1046ada9fc
1 changed files with 14 additions and 14 deletions
|
@ -60,44 +60,44 @@ class phpbb_datetime_from_format_test extends phpbb_test_case
|
|||
// If the current time is too close to the testing time,
|
||||
// the relative time will use "x minutes ago" instead of "today ..."
|
||||
// So we use 18:01 in the morning and 06:01 in the afternoon.
|
||||
$testing_time = date('H') <= 12 ? '18:01' : '06:01';
|
||||
$testing_time = gmdate('H') <= 12 ? '18:01' : '06:01';
|
||||
|
||||
return array(
|
||||
array(
|
||||
date('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time, false,
|
||||
date('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time,
|
||||
gmdate('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time, false,
|
||||
gmdate('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time,
|
||||
),
|
||||
|
||||
array(
|
||||
date('Y-m-d', time() + 86400) . ' ' . $testing_time, false,
|
||||
gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time, false,
|
||||
'Tomorrow ' . $testing_time,
|
||||
),
|
||||
array(
|
||||
date('Y-m-d', time() + 86400) . ' ' . $testing_time, true,
|
||||
date('Y-m-d', time() + 86400) . ' ' . $testing_time,
|
||||
gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time, true,
|
||||
gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time,
|
||||
),
|
||||
|
||||
array(
|
||||
date('Y-m-d') . ' ' . $testing_time, false,
|
||||
gmdate('Y-m-d') . ' ' . $testing_time, false,
|
||||
'Today ' . $testing_time,
|
||||
),
|
||||
array(
|
||||
date('Y-m-d') . ' ' . $testing_time, true,
|
||||
date('Y-m-d') . ' ' . $testing_time,
|
||||
gmdate('Y-m-d') . ' ' . $testing_time, true,
|
||||
gmdate('Y-m-d') . ' ' . $testing_time,
|
||||
),
|
||||
|
||||
array(
|
||||
date('Y-m-d', time() - 86400) . ' ' . $testing_time, false,
|
||||
gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time, false,
|
||||
'Yesterday ' . $testing_time,
|
||||
),
|
||||
array(
|
||||
date('Y-m-d', time() - 86400) . ' ' . $testing_time, true,
|
||||
date('Y-m-d', time() - 86400) . ' ' . $testing_time,
|
||||
gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time, true,
|
||||
gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time,
|
||||
),
|
||||
|
||||
array(
|
||||
date('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time, false,
|
||||
date('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time,
|
||||
gmdate('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time, false,
|
||||
gmdate('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue