mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 02:05:19 +02:00
Move DirectMessages/Destory tests & fix Destroy condition
This commit is contained in:
parent
3374cac767
commit
0c4c6faa54
3 changed files with 113 additions and 98 deletions
|
@ -1189,103 +1189,6 @@ class ApiTest extends FixtureTest
|
|||
// self::assertArrayHasKey('user', $result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test the api_direct_messages_destroy() function.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiDirectMessagesDestroy()
|
||||
{
|
||||
//$this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
|
||||
//api_direct_messages_destroy('json');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_direct_messages_destroy() function with the friendica_verbose GET param.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiDirectMessagesDestroyWithVerbose()
|
||||
{
|
||||
/*
|
||||
$_GET['friendica_verbose'] = 'true';
|
||||
$result = api_direct_messages_destroy('json');
|
||||
self::assertEquals(
|
||||
[
|
||||
'$result' => [
|
||||
'result' => 'error',
|
||||
'message' => 'message id or parenturi not specified'
|
||||
]
|
||||
],
|
||||
$result
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_direct_messages_destroy() function without an authenticated user.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiDirectMessagesDestroyWithoutAuthenticatedUser()
|
||||
{
|
||||
/*
|
||||
$this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
|
||||
BasicAuth::setCurrentUserID();
|
||||
$_SESSION['authenticated'] = false;
|
||||
api_direct_messages_destroy('json');
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_direct_messages_destroy() function with a non-zero ID.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiDirectMessagesDestroyWithId()
|
||||
{
|
||||
/*
|
||||
$this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
|
||||
$_REQUEST['id'] = 1;
|
||||
api_direct_messages_destroy('json');
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_direct_messages_destroy() with a non-zero ID and the friendica_verbose GET param.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiDirectMessagesDestroyWithIdAndVerbose()
|
||||
{
|
||||
/*
|
||||
$_REQUEST['id'] = 1;
|
||||
$_REQUEST['friendica_parenturi'] = 'parent_uri';
|
||||
$_GET['friendica_verbose'] = 'true';
|
||||
$result = api_direct_messages_destroy('json');
|
||||
self::assertEquals(
|
||||
[
|
||||
'$result' => [
|
||||
'result' => 'error',
|
||||
'message' => 'message id not in database'
|
||||
]
|
||||
],
|
||||
$result
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_direct_messages_destroy() function with a non-zero ID.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testApiDirectMessagesDestroyWithCorrectId()
|
||||
{
|
||||
$this->markTestIncomplete('We need to add a dataset for this.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the api_direct_messages_box() function.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue