diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-10-15 02:02:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-15 02:02:07 +0300 |
commit | 148e049bc7665af470514a8f0a573973fc59a52b (patch) | |
tree | 1e0fa8246520a5d85f6e147851525b6fa7495e39 /plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php | |
parent | e86968b23507261f58a3f0e9f20d61d0e47ae331 (diff) |
Fix mismatched visitors (Overview / Visitor Log) when segment is applied (#14963)
Diffstat (limited to 'plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php')
-rw-r--r-- | plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php b/plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php index b08eee5297..d2bcb9f302 100644 --- a/plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php +++ b/plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php @@ -55,14 +55,25 @@ class ManyVisitsOfSameVisitor extends Fixture $t->setTokenAuth(self::getTokenAuth()); $t->enableBulkTracking(); - for ($numVisits = 0; $numVisits <= 30; $numVisits++) { + // -2 because we want to make sure to have 3 visits for the first day + for ($numVisits = -2; $numVisits <= 30; $numVisits++) { $t->setForceNewVisit(); $t->setUrl('http://example.org/my/dir/page' . ($numVisits % 4)); - $visitDateTime = Date::factory($this->dateTime)->addDay($numVisits)->getDatetime(); - $t->setForceVisitDateTime($visitDateTime); + if ($numVisits > 0) { + $visitDateTime = Date::factory($this->dateTime)->addDay($numVisits)->getDatetime(); + $t->setForceVisitDateTime($visitDateTime); + } self::assertTrue($t->doTrackPageView('incredible title ' . ($numVisits % 3))); + + if ($numVisits === -2) { + for ($k = 0; $k < 10; $k++) { + // we generate many actions to make sure in the test when we segment by page title that it not just + // returns one visit but multiple visits to ensure the group by is correct + self::assertTrue($t->doTrackPageView('incredible title 1')); + } + } } self::checkBulkTrackingResponse($t->doBulkTrack()); |