Update tests about api_show_status()

- Remove testApiStatusShowWithRaw()
- Add testApiGetLastStatus()
- Mark testApiStatusShowWithJson() and testApiStatusShowWithXml() as skipped as they require an item id
This commit is contained in:
Hypolite Petovan 2019-03-02 16:11:56 -05:00
parent aa6192258e
commit bb78768fb2

View file

@ -1274,8 +1274,10 @@ class ApiTest extends DatabaseTest
* Test the api_status_show() function. * Test the api_status_show() function.
* @return void * @return void
*/ */
public function testApiStatusShow() public function testApiStatusShowWithJson()
{ {
$this->markTestSkipped('This test requires an item ID');
$result = api_status_show('json'); $result = api_status_show('json');
$this->assertStatus($result['status']); $this->assertStatus($result['status']);
} }
@ -1286,6 +1288,8 @@ class ApiTest extends DatabaseTest
*/ */
public function testApiStatusShowWithXml() public function testApiStatusShowWithXml()
{ {
$this->markTestSkipped('This test requires an item ID');
$result = api_status_show('xml'); $result = api_status_show('xml');
$this->assertXml($result, 'statuses'); $this->assertXml($result, 'statuses');
} }
@ -1294,9 +1298,11 @@ class ApiTest extends DatabaseTest
* Test the api_status_show() function with a raw result. * Test the api_status_show() function with a raw result.
* @return void * @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']));
} }
/** /**