Skip to content

Commit

Permalink
test: fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
zeriyoshi committed Aug 15, 2024
1 parent f7fb684 commit facac19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/tests/variables/request_time_float.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ colopl_timeshifter

$before_request_time = $_SERVER['REQUEST_TIME_FLOAT'];

\Colopl\ColoplTimeShifter\register_hook(new \DateInterval('P1Y'));
\Colopl\ColoplTimeShifter\register_hook(new \DateInterval('P2Y'));

$after_request_time = $_SERVER['REQUEST_TIME_FLOAT'];

Expand All @@ -16,7 +16,7 @@ $after = new \DateTime('@' . $after_request_time);

$interval = $after->diff($before);

if ($before == $after || $interval->y !== 1 || $interval->invert !== 0) {
if ($before == $after || $interval->y <= 0 || $interval->invert !== 0) {
die('failed');
}

Expand Down

0 comments on commit facac19

Please sign in to comment.