Move DirectMessages/Conversation tests

This commit is contained in:
Philipp Holzer 2021-12-30 20:18:34 +01:00
parent 07eca542a4
commit 0f40aec0e3
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
2 changed files with 32 additions and 37 deletions

View file

@ -1189,44 +1189,7 @@ class ApiTest extends FixtureTest
// self::assertArrayHasKey('user', $result);
}
/**
* Test the api_direct_messages_box() function.
*
* @return void
*/
public function testApiDirectMessagesBoxWithSentbox()
{
/*
$_REQUEST['page'] = -1;
$_REQUEST['max_id'] = 10;
$result = api_direct_messages_box('json', 'sentbox', 'false');
self::assertArrayHasKey('direct_message', $result);
*/
}
/**
* Test the api_direct_messages_box() function.
*
* @return void
*/
public function testApiDirectMessagesBoxWithConversation()
{
//$result = api_direct_messages_box('json', 'conversation', 'false');
//self::assertArrayHasKey('direct_message', $result);
}
/**
* Test the api_direct_messages_conversation() function.
*
* @return void
*/
public function testApiDirectMessagesConversation()
{
//$result = api_direct_messages_conversation('json');
//self::assertArrayHasKey('direct_message', $result);
}
/**
* Test the api_oauth_request_token() function.

View file

@ -0,0 +1,32 @@
<?php
namespace Friendica\Test\src\Module\Api\Twitter\DirectMessages;
use Friendica\App\Router;
use Friendica\DI;
use Friendica\Factory\Api\Twitter\DirectMessage;
use Friendica\Module\Api\Twitter\DirectMessages\Conversation;
use Friendica\Test\src\Module\Api\ApiTest;
class ConversationTest extends ApiTest
{
/**
* Test the api_direct_messages_box() function.
*
* @return void
*/
public function testApiDirectMessagesBoxWithConversation()
{
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$sent = new Conversation($directMessage, DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET], ['extension' => 'json']);
$response = $sent->run([
'friendica_verbose' => true,
]);
$json = $this->toJson($response);
self::assertEquals('error', $json->result);
self::assertEquals('no mails available', $json->message);
}
}