Skip to content

Commit

Permalink
Adjust tracker usage to recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Oct 8, 2024
1 parent c794760 commit e897634
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private function trackVisits()
$t = self::getTracker($this->idSite2, $this->dateTime, $defaultInit = true);
$t->setTokenAuth(self::getTokenAuth());
$t->setForceNewVisit();
$t->setUserId(101);
$t->setUserId('101');
$t->setUrl('http://example.org/foo/dir/page');

$visitDateTime = Date::factory($this->dateTime)->getDatetime();
Expand Down
2 changes: 1 addition & 1 deletion tests/LocalTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class Matomo_LocalTracker extends MatomoTracker
{
protected function sendRequest($url, $method = 'GET', $data = null, $force = false)
protected function sendRequest(string $url, string $method = 'GET', $data = null, bool $force = false)
{
self::$DEBUG_LAST_REQUESTED_URL = $url;

Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private function trackVisitsSetUserId()
self::checkResponse($t->doTrackPageView('second pageview - by this user id'));

// Request from a different computer not yet logged in, this should not be added to our User ID session
$t->setUserId(false);
$t->setUserId(null);
// make sure the Id is not so random as to not fail the test
$t->setVisitorId('5e15b4d842cc294d');

Expand Down
2 changes: 2 additions & 0 deletions tests/PHPUnit/Framework/Fixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,8 @@ public static function getTokenAuth()
if (!empty($user)) {
return self::ADMIN_USER_TOKEN;
}

return null;
}

public static function createSuperUser($removeExisting = true)
Expand Down

0 comments on commit e897634

Please sign in to comment.