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

Date factory test when date object is passed #15998

Merged
merged 5 commits into from Jun 10, 2020
Merged

Date factory test when date object is passed #15998

merged 5 commits into from Jun 10, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented May 27, 2020

As suggested in chat made this change to see if anything breaks.

There are some failing tests in CustomEvents and Content tracking but that's because of how the date was falsely used in the test fixture. Happy to update the tests and add a changelog entry if we are keen to merge this. Not sure what else it would maybe break that maybe isn't covered by tests.

@@ -60,7 +60,7 @@ public function trackVisits()
$this->trackEventWithoutUrl($vis);
$this->trackMovieWatchingIncludingInterval($vis);

$this->dateTime = Date::factory($this->dateTime)->addHour(0.5);
$this->dateTime = Date::factory($this->dateTime)->addHour(0.5)->getDatetime();
$vis2 = self::getTracker($this->idSite, $this->dateTime, $useDefault = true, $uselocal);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we used to pass a Date object here meaning the tracker would do $date->toString() which then would only result in YYYY-MM-DD and throw away the entire time. So this was before actually not working which is why some tests are failing.

@@ -47,7 +47,7 @@ public function trackVisits()

$this->trackContentImpressionsAndInteractions($vis);

$this->dateTime = Date::factory($this->dateTime)->addHour(0.5);
$this->dateTime = Date::factory($this->dateTime)->addHour(0.5)->getDatetime();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we used to pass a Date object here meaning the tracker would do $date->toString() which then would only result in YYYY-MM-DD and throw away the entire time. So this was before actually not working which is why some tests are failing.

@tsteur tsteur added the Needs Review PRs that need a code review label May 27, 2020
@tsteur tsteur added this to the 4.0.0 milestone May 27, 2020
@tsteur tsteur added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label May 27, 2020
@tsteur tsteur added Needs Review PRs that need a code review and removed Needs Review PRs that need a code review Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels May 27, 2020
@tsteur
Copy link
Member Author

tsteur commented May 27, 2020

Any thoughts @sgiehl @diosmosis ?

@sgiehl
Copy link
Member

sgiehl commented Jun 3, 2020

In general I would vote for fixing the tests and merging this change. That is actually the behavior I imho would have expected before 🙈

@tsteur
Copy link
Member Author

tsteur commented Jun 3, 2020

👍 fixed the tests @sgiehl

@tsteur tsteur merged commit 0834bbd into 4.x-dev Jun 10, 2020
@tsteur tsteur deleted the datefactory branch June 10, 2020 23:20
@mattab mattab added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. and removed not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants