]> git.mxchange.org Git - friendica.git/blobdiff - tests/include/ApiTest.php
Merge pull request #7907 from nupplaphil/task/reduce_app_deps
[friendica.git] / tests / include / ApiTest.php
index 3410f3049df83a1660b9c7cd0c76ca1c773c653d..ef46a4d447c729c4aa17f4664c6d2fab9f63e227 100644 (file)
@@ -11,6 +11,8 @@ use Friendica\BaseObject;
 use Friendica\Core\Config\Configuration;
 use Friendica\Core\Config\PConfiguration;
 use Friendica\Core\Protocol;
+use Friendica\Core\Session;
+use Friendica\Core\Session\ISession;
 use Friendica\Core\System;
 use Friendica\Database\Database;
 use Friendica\Network\HTTPException;
@@ -59,7 +61,8 @@ class ApiTest extends DatabaseTest
 
                $this->dice = (new Dice())
                        ->addRules(include __DIR__ . '/../../static/dependencies.config.php')
-                       ->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
+                       ->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true])
+                       ->addRule(ISession::class, ['instanceOf' => Session\Memory::class, 'shared' => true, 'call' => null]);
                BaseObject::setDependencyInjection($this->dice);
 
                /** @var Database $dba */
@@ -111,6 +114,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,
@@ -3775,16 +3782,6 @@ class ApiTest extends DatabaseTest
                $this->assertEquals('some_text [url="some_url"]"some_url"[/url]', $result);
        }
 
-       /**
-        * Test the api_clean_attachments() function.
-        *
-        * @return void
-        */
-       public function testApiCleanAttachments()
-       {
-               $this->markTestIncomplete();
-       }
-
        /**
         * Test the api_best_nickname() function.
         *