Add tests for api_status_show
- Update test for api_get_last_status() - Add test class properties declaration
This commit is contained in:
parent
ab7ec357cb
commit
fb13d0c31b
|
@ -31,6 +31,18 @@ class ApiTest extends DatabaseTest
|
||||||
*/
|
*/
|
||||||
protected $logOutput;
|
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.
|
* Create variables used by tests.
|
||||||
*/
|
*/
|
||||||
|
@ -1272,37 +1284,30 @@ class ApiTest extends DatabaseTest
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the api_status_show() function.
|
* Test the api_status_show() function.
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function testApiStatusShowWithJson()
|
public function testApiStatusShowWithJson()
|
||||||
{
|
{
|
||||||
$this->markTestSkipped('This test requires an item ID');
|
$result = api_status_show('json', 1);
|
||||||
|
|
||||||
$result = api_status_show('json');
|
|
||||||
$this->assertStatus($result['status']);
|
$this->assertStatus($result['status']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the api_status_show() function with an XML result.
|
* Test the api_status_show() function with an XML result.
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function testApiStatusShowWithXml()
|
public function testApiStatusShowWithXml()
|
||||||
{
|
{
|
||||||
$this->markTestSkipped('This test requires an item ID');
|
$result = api_status_show('xml', 1);
|
||||||
|
|
||||||
$result = api_status_show('xml');
|
|
||||||
$this->assertXml($result, 'statuses');
|
$this->assertXml($result, 'statuses');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the api_status_show() function with a raw result.
|
* Test the api_get_last_status() function
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function testApiGetLastStatus()
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user