]> git.mxchange.org Git - friendica.git/blobdiff - tests/include/ApiTest.php
Remove legacy function
[friendica.git] / tests / include / ApiTest.php
index 098337aab9cea8e80638a9cc811d158437ecc059..3d6bdc0c16816c8adb8fd862441e3bb36678e385 100644 (file)
@@ -13,6 +13,7 @@ use Friendica\Core\Config\PConfiguration;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
 use Friendica\Database\Database;
+use Friendica\Model\Contact;
 use Friendica\Network\HTTPException;
 use Friendica\Test\Util\Database\StaticDatabase;
 use Monolog\Handler\TestHandler;
@@ -57,9 +58,9 @@ class ApiTest extends DatabaseTest
        {
                parent::setUp();
 
-               $this->dice = new Dice();
-               $this->dice = $this->dice->addRules(include __DIR__ . '/../../static/dependencies.config.php');
-               $this->dice = $this->dice->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
+               $this->dice = (new Dice())
+                       ->addRules(include __DIR__ . '/../../static/dependencies.config.php')
+                       ->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
                BaseObject::setDependencyInjection($this->dice);
 
                /** @var Database $dba */
@@ -2922,8 +2923,8 @@ class ApiTest extends DatabaseTest
         */
        public function testApiFfIds()
        {
-               $result = api_ff_ids('json');
-               $this->assertNull($result);
+               $result = api_ff_ids('json', Contact::FOLLOWER);
+               $this->assertEquals(['id' => []], $result);
        }
 
        /**
@@ -2945,7 +2946,7 @@ class ApiTest extends DatabaseTest
        public function testApiFfIdsWithoutAuthenticatedUser()
        {
                $_SESSION['authenticated'] = false;
-               api_ff_ids('json');
+               api_ff_ids('json', Contact::FOLLOWER);
        }
 
        /**
@@ -2956,7 +2957,7 @@ class ApiTest extends DatabaseTest
        public function testApiFriendsIds()
        {
                $result = api_friends_ids('json');
-               $this->assertNull($result);
+               $this->assertEquals(['id' => []], $result);
        }
 
        /**
@@ -2967,7 +2968,7 @@ class ApiTest extends DatabaseTest
        public function testApiFollowersIds()
        {
                $result = api_followers_ids('json');
-               $this->assertNull($result);
+               $this->assertEquals(['id' => []], $result);
        }
 
        /**
@@ -3716,28 +3717,6 @@ class ApiTest extends DatabaseTest
                $this->markTestIncomplete();
        }
 
-       /**
-        * Test the api_get_nick() function.
-        *
-        * @return void
-        */
-       public function testApiGetNick()
-       {
-               $result = api_get_nick($this->otherUser['nurl']);
-               $this->assertEquals('othercontact', $result);
-       }
-
-       /**
-        * Test the api_get_nick() function with a wrong URL.
-        *
-        * @return void
-        */
-       public function testApiGetNickWithWrongUrl()
-       {
-               $result = api_get_nick('wrong_url');
-               $this->assertFalse($result);
-       }
-
        /**
         * Test the api_in_reply_to() function.
         *
@@ -3775,16 +3754,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.
         *