From 0f40aec0e3431de8651774e67480fdbd9b7ba13e Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 30 Dec 2021 20:18:34 +0100 Subject: [PATCH] Move DirectMessages/Conversation tests --- tests/legacy/ApiTest.php | 37 ------------------- .../DirectMessages/ConversationTest.php | 32 ++++++++++++++++ 2 files changed, 32 insertions(+), 37 deletions(-) create mode 100644 tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php diff --git a/tests/legacy/ApiTest.php b/tests/legacy/ApiTest.php index 743af75e0a..e7fba6583e 100644 --- a/tests/legacy/ApiTest.php +++ b/tests/legacy/ApiTest.php @@ -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. diff --git a/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php b/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php new file mode 100644 index 0000000000..815d5eb577 --- /dev/null +++ b/tests/src/Module/Api/Twitter/DirectMessages/ConversationTest.php @@ -0,0 +1,32 @@ + 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); + } +}