diff --git a/plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php b/plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php index d0dfef0d172d..73b68a21d61e 100644 --- a/plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php +++ b/plugins/Live/tests/Fixtures/ManyVisitsOfSameVisitor.php @@ -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(); diff --git a/tests/LocalTracker.php b/tests/LocalTracker.php index f4a4bf5da29d..c682985fa9e7 100644 --- a/tests/LocalTracker.php +++ b/tests/LocalTracker.php @@ -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; diff --git a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php index c283d51d83ea..0b953f230153 100644 --- a/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php +++ b/tests/PHPUnit/Fixtures/FewVisitsWithSetVisitorId.php @@ -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'); diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php index 0fef8b643de6..179e008d8c0e 100644 --- a/tests/PHPUnit/Framework/Fixture.php +++ b/tests/PHPUnit/Framework/Fixture.php @@ -758,6 +758,8 @@ public static function getTokenAuth() if (!empty($user)) { return self::ADMIN_USER_TOKEN; } + + return null; } public static function createSuperUser($removeExisting = true)