]> git.mxchange.org Git - friendica.git/commitdiff
Add tests for api_status_show
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Mar 2019 14:02:32 +0000 (10:02 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Mar 2019 18:28:54 +0000 (14:28 -0400)
- Update test for api_get_last_status()
- Add test class properties declaration

tests/include/ApiTest.php

index 39f4ef79c269d4a92367f6317e2a122592bebb72..df3a7e9401f9335e0fe96a49c64d0e0b0380373d 100644 (file)
@@ -31,6 +31,18 @@ class ApiTest extends DatabaseTest
         */
        protected $logOutput;
 
+       /** @var App */
+       protected $app;
+
+       /** @var array */
+       protected $selfUser;
+       /** @var array */
+       protected $friendUser;
+       /** @var array */
+       protected $otherUser;
+
+       protected $wrongUserId;
+
        /**
         * Create variables used by tests.
         */
@@ -1272,37 +1284,30 @@ class ApiTest extends DatabaseTest
 
        /**
         * Test the api_status_show() function.
-        * @return void
         */
        public function testApiStatusShowWithJson()
        {
-               $this->markTestSkipped('This test requires an item ID');
-
-               $result = api_status_show('json');
+               $result = api_status_show('json', 1);
                $this->assertStatus($result['status']);
        }
 
        /**
         * Test the api_status_show() function with an XML result.
-        * @return void
         */
        public function testApiStatusShowWithXml()
        {
-               $this->markTestSkipped('This test requires an item ID');
-
-               $result = api_status_show('xml');
+               $result = api_status_show('xml', 1);
                $this->assertXml($result, 'statuses');
        }
 
        /**
-        * Test the api_status_show() function with a raw result.
-        * @return void
+        * Test the api_get_last_status() function
         */
        public function testApiGetLastStatus()
        {
-               $user_info = api_get_user($this->app);
+               $item = api_get_last_status($this->selfUser['id'], $this->selfUser['id']);
 
-               $this->assertStatus(api_get_last_status($user_info['pid'], $user_info['uid']));
+               $this->assertNotNull($item);
        }
 
        /**