From: nupplaPhil Date: Tue, 10 Dec 2019 22:35:16 +0000 (+0100) Subject: Overwrite constructor of Memory session handling so no session ini-setting in backend... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=02c40ad1cbc66cadea77180b8b9340521381cce5;p=friendica.git Overwrite constructor of Memory session handling so no session ini-setting in backend/testing environments are possible --- diff --git a/src/Core/Session/Memory.php b/src/Core/Session/Memory.php index b39234db23..f8d02b5538 100644 --- a/src/Core/Session/Memory.php +++ b/src/Core/Session/Memory.php @@ -2,6 +2,9 @@ namespace Friendica\Core\Session; +use Friendica\Core\Config\Configuration; +use Friendica\Model\User\Cookie; + /** * Usable for backend processes (daemon/worker) and testing * @@ -9,6 +12,11 @@ namespace Friendica\Core\Session; */ final class Memory extends Native { + public function __construct(Configuration $config, Cookie $cookie) + { + $this->cookie = $cookie; + } + public function start() { // Backward compatibility until all Session variables are replaced diff --git a/tests/include/ApiTest.php b/tests/include/ApiTest.php index 63e8d23453..ef46a4d447 100644 --- a/tests/include/ApiTest.php +++ b/tests/include/ApiTest.php @@ -62,7 +62,7 @@ class ApiTest extends DatabaseTest $this->dice = (new Dice()) ->addRules(include __DIR__ . '/../../static/dependencies.config.php') ->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]) - ->addRule(ISession::class, ['instanceOf' => Session\Memory::class, 'shared' => true]); + ->addRule(ISession::class, ['instanceOf' => Session\Memory::class, 'shared' => true, 'call' => null]); BaseObject::setDependencyInjection($this->dice); /** @var Database $dba */