Move DirectMessages/Destory tests & fix Destroy condition

This commit is contained in:
Philipp 2021-12-30 19:58:19 +01:00
parent 3374cac767
commit 0c4c6faa54
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
3 changed files with 113 additions and 98 deletions

View file

@ -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.
*