diff --git a/tests/legacy/ApiTest.php b/tests/legacy/ApiTest.php index e2224a19a1..550bc54c27 100644 --- a/tests/legacy/ApiTest.php +++ b/tests/legacy/ApiTest.php @@ -710,6 +710,7 @@ class ApiTest extends FixtureTest $_SERVER['PHP_AUTH_USER'] = 'Test user'; $_SERVER['PHP_AUTH_PW'] = 'password'; $_SESSION['allow_api'] = false; + BasicAuth::setCurrentUserID(); self::assertFalse(api_get_user()); } @@ -1423,6 +1424,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_search('json'); } @@ -1479,6 +1481,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_statuses_home_timeline('json'); } @@ -1550,6 +1553,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_statuses_public_timeline('json'); } @@ -1604,6 +1608,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_statuses_networkpublic_timeline('json'); } @@ -1667,6 +1672,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_statuses_show('json'); } @@ -1708,6 +1714,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_conversation_show('json'); } @@ -1822,6 +1829,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_statuses_mentions('json'); } @@ -1889,6 +1897,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_statuses_user_timeline('json'); } @@ -2017,6 +2026,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_favorites('json'); } @@ -2442,6 +2452,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_lists_statuses('json'); } @@ -2868,6 +2879,7 @@ class ApiTest extends FixtureTest $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class); $_SESSION['allow_api'] = false; $_GET['screen_name'] = $this->selfUser['nick']; + BasicAuth::setCurrentUserID(); api_direct_messages_box('json', 'sentbox', 'false'); }