Skip to content
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

Merged
merged 5 commits into from Apr 16, 2019
Merged

Fix archive invalidation timezone issue in tracker #14318

merged 5 commits into from Apr 16, 2019

Conversation

katebutler
Copy link

Fixes #14298

public function test_archiveInvalidation_differentServerAndWebsiteTimezones()
{
// Server timezone is UTC
ini_set('date.timezone', 'America/New_York');
Copy link
Member

@diosmosis diosmosis Apr 5, 2019

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?

Copy link
Member

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?

@diosmosis diosmosis added this to the 3.10.0 milestone Apr 7, 2019
@diosmosis diosmosis added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Apr 7, 2019
@diosmosis
Copy link
Member

Code looks good, but an integration test is failing. After it's fixed, this can be merged.

@katebutler
Copy link
Author

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();
Copy link
Member

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 :)

@tsteur tsteur merged commit 6a1442f into 3.x-dev Apr 16, 2019
@tsteur tsteur deleted the 14298 branch April 16, 2019 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking can cause requests to option table
3 participants