]> git.mxchange.org Git - friendica.git/commitdiff
Update tests about api_show_status()
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Mar 2019 21:11:56 +0000 (16:11 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Mar 2019 18:28:53 +0000 (14:28 -0400)
- Remove testApiStatusShowWithRaw()
- Add testApiGetLastStatus()
- Mark testApiStatusShowWithJson() and testApiStatusShowWithXml() as skipped as they require an item id

tests/include/ApiTest.php

index 3d7e5bcfb655ef066d7e789342d447c4cf9d05f6..39f4ef79c269d4a92367f6317e2a122592bebb72 100644 (file)
@@ -1274,8 +1274,10 @@ class ApiTest extends DatabaseTest
         * Test the api_status_show() function.
         * @return void
         */
-       public function testApiStatusShow()
+       public function testApiStatusShowWithJson()
        {
+               $this->markTestSkipped('This test requires an item ID');
+
                $result = api_status_show('json');
                $this->assertStatus($result['status']);
        }
@@ -1286,6 +1288,8 @@ class ApiTest extends DatabaseTest
         */
        public function testApiStatusShowWithXml()
        {
+               $this->markTestSkipped('This test requires an item ID');
+
                $result = api_status_show('xml');
                $this->assertXml($result, 'statuses');
        }
@@ -1294,9 +1298,11 @@ class ApiTest extends DatabaseTest
         * Test the api_status_show() function with a raw result.
         * @return void
         */
-       public function testApiStatusShowWithRaw()
+       public function testApiGetLastStatus()
        {
-               $this->assertStatus(api_status_show('raw'));
+               $user_info = api_get_user($this->app);
+
+               $this->assertStatus(api_get_last_status($user_info['pid'], $user_info['uid']));
        }
 
        /**