// Most API require login so we force the session
$_SESSION = [
- 'allow_api' => true,
'authenticated' => true,
'uid' => $this->selfUser['id']
];
*/
public function testApiUserWithUnallowedUser()
{
- $_SESSION = ['allow_api' => false];
- self::assertEquals(false, api_user());
+ // self::assertEquals(false, api_user());
}
/**
/*
$_SERVER['PHP_AUTH_USER'] = 'Test user';
$_SERVER['PHP_AUTH_PW'] = 'password';
- $_SESSION['allow_api'] = false;
BasicAuth::setCurrentUserID();
self::assertFalse(api_get_user());
*/
public function testApiSearchWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_search('json');
public function testApiStatusesHomeTimelineWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_statuses_home_timeline('json');
public function testApiStatusesPublicTimelineWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_statuses_public_timeline('json');
public function testApiStatusesNetworkpublicTimelineWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_statuses_networkpublic_timeline('json');
public function testApiStatusesShowWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_statuses_show('json');
public function testApiConversationShowWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_conversation_show('json');
public function testApiStatusesMentionsWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_statuses_mentions('json');
public function testApiStatusesUserTimelineWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_statuses_user_timeline('json');
public function testApiFavoritesWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_favorites('json');
public function testApiListsStatusesWithUnallowedUser()
{
$this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
- $_SESSION['allow_api'] = false;
$_GET['screen_name'] = $this->selfUser['nick'];
BasicAuth::setCurrentUserID();
api_lists_statuses('json');
public function testApiDirectMessagesBoxWithUnallowedUser()
{
$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');