New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix archive invalidation timezone issue in tracker #14318
Conversation
public function test_archiveInvalidation_differentServerAndWebsiteTimezones() | ||
{ | ||
// Server timezone is UTC | ||
ini_set('date.timezone', 'America/New_York'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be unset in a tearDown method to make sure the timezone isn't different for other tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 in setUp
we would maybe also need to remember the initial timezone and then restore the original timezone in tearDown
?
Code looks good, but an integration test is failing. After it's fixed, this can be merged. |
The integration test that was failing when UTC and UTC+5 are different dates has been fixed |
|
||
$currentActionTime1 = Date::today()->setTimezone($timezone1)->getDatetime(); | ||
$currentActionTime2 = Date::today()->setTimezone($timezone2)->getDatetime(); | ||
$oneHourAfterMidnight = $midnight->addHour(1)->getDatetime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those variables are a lot more easier to read and make a lot more sense 👍 This way I would have probably noticed while writing the tests the previous assertions were wrong :)
Fixes #14298