expectException(\Friendica\Network\HTTPException\UnauthorizedException::class); BasicAuth::getCurrentUserID(true); */ } /** * Test the BasicAuth::getCurrentUserID() function with a bad login. */ public function testApiLoginWithBadLogin() { self::markTestIncomplete('Needs Refactoring of BasicAuth first.'); /* BasicAuth::setCurrentUserID(); $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class); $_SERVER['PHP_AUTH_USER'] = 'user@server'; BasicAuth::getCurrentUserID(true); */ } /** * Test the BasicAuth::getCurrentUserID() function with a correct login. */ public function testApiLoginWithCorrectLogin() { BasicAuth::setCurrentUserID(); $_SERVER['PHP_AUTH_USER'] = 'Test user'; $_SERVER['PHP_AUTH_PW'] = 'password'; self::assertEquals(parent::SELF_USER['id'], BasicAuth::getCurrentUserID(true)); } /** * Test the BasicAuth::getCurrentUserID() function with a remote user. */ public function testApiLoginWithRemoteUser() { self::markTestIncomplete('Needs Refactoring of BasicAuth first.'); /* BasicAuth::setCurrentUserID(); $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class); $_SERVER['REDIRECT_REMOTE_USER'] = '123456dXNlcjpwYXNzd29yZA=='; BasicAuth::getCurrentUserID(true); */ } }