Use Native Session functions (global "$_SESSION" variable) for Memory class because of the direct usage of the $_SESSION class all around the codebase

This commit is contained in:
nupplaPhil 2019-12-10 22:29:49 +01:00
parent eca3396851
commit b9f8762eb3
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
4 changed files with 13 additions and 73 deletions

View file

@ -11,6 +11,7 @@ use Friendica\BaseObject;
use Friendica\Core\Config\Configuration;
use Friendica\Core\Config\PConfiguration;
use Friendica\Core\Protocol;
use Friendica\Core\Session\ISession;
use Friendica\Core\System;
use Friendica\Database\Database;
use Friendica\Network\HTTPException;
@ -111,6 +112,10 @@ class ApiTest extends DatabaseTest
// User ID that we know is not in the database
$this->wrongUserId = 666;
/** @var ISession $session */
$session = BaseObject::getClass(ISession::class);
$session->start();
// Most API require login so we force the session
$_SESSION = [
'allow_api' => true,