Skip to content

Commit

Permalink
Fix one test refs #6313
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Oct 1, 2014
1 parent be25924 commit 2cd5f09
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorIdAndUserId.php
Expand Up @@ -90,6 +90,7 @@ private function trackVisits_setUserId()
// We create a visit with no User ID.
// When User ID will be set below, then it will UPDATE this visit here that starts without UserID
$t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(1.9)->getDatetime());
$t->setVisitorId('6be121d126d93581');
$t->setUrl('http://example.org/no-user-id-set-but-should-appear-in-user-id-visit');
self::checkResponse($t->doTrackPageView('no User Id set but it should appear in '. $userId .'!'));

Expand All @@ -106,17 +107,18 @@ private function trackVisits_setUserId()

// Set User ID
$t->setUserId($userId);
$this->assertEquals($userId, $t->getUserId());

// User ID takes precedence over any previously set Visitor ID
$hashUserId = $t->getUserIdHashed($userId);
$this->assertEquals($hashUserId, $t->getVisitorId());
$this->assertEquals($t->getUserIdHashed($userId), $t->getVisitorId());
$this->assertEquals('9395988394d4568d', $t->getVisitorId());
$this->assertEquals($userId, $t->getUserId());

// Track a pageview with this user id
self::checkResponse($t->doTrackPageView('incredible title!'));

// Track another pageview
$t->setForceVisitDateTime(Date::factory($this->dateTime)->addHour(2.1)->getDatetime());
$this->assertEquals($userId, $t->getUserId());
self::checkResponse($t->doTrackPageView('second page'));

// A NEW VISIT WITH A SET USER ID
Expand Down

0 comments on commit 2cd5f09

Please sign in to comment.