Move DirectMessages/Conversation tests
This commit is contained in:
parent
07eca542a4
commit
0f40aec0e3
|
@ -1189,44 +1189,7 @@ class ApiTest extends FixtureTest
|
||||||
// self::assertArrayHasKey('user', $result);
|
// 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.
|
* Test the api_oauth_request_token() function.
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user