From abbe7895ae48570a9fc87b4ed85fd8a75c1c83f5 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 17 Nov 2021 22:12:21 +0000 Subject: [PATCH] Fixing tests - maybe --- src/Security/BasicAuth.php | 5 +++++ tests/legacy/ApiTest.php | 1 + 2 files changed, 6 insertions(+) diff --git a/src/Security/BasicAuth.php b/src/Security/BasicAuth.php index f2154ae8a..2b4baaa36 100644 --- a/src/Security/BasicAuth.php +++ b/src/Security/BasicAuth.php @@ -62,6 +62,11 @@ class BasicAuth return (int)self::$current_user_id; } + public static function setCurrentUserID(int $uid) + { + self::$current_user_id = $uid; + } + /** * Fetch a dummy application token * diff --git a/tests/legacy/ApiTest.php b/tests/legacy/ApiTest.php index e19354159..1e5f12d85 100644 --- a/tests/legacy/ApiTest.php +++ b/tests/legacy/ApiTest.php @@ -114,6 +114,7 @@ class ApiTest extends FixtureTest 'authenticated' => true, 'uid' => $this->selfUser['id'] ]; + BasicAuth::setCurrentUserID($this->selfUser['id']); } /**