diff --git a/tests/legacy/ApiTest.php b/tests/legacy/ApiTest.php index 239e297d3e..5203e90a55 100644 --- a/tests/legacy/ApiTest.php +++ b/tests/legacy/ApiTest.php @@ -1226,17 +1226,6 @@ class ApiTest extends FixtureTest //self::assertArrayHasKey('direct_message', $result); } - /** - * Test the api_direct_messages_box() function. - * - * @return void - */ - public function testApiDirectMessagesBoxWithInbox() - { - //$result = api_direct_messages_box('json', 'inbox', 'false'); - //self::assertArrayHasKey('direct_message', $result); - } - /** * Test the api_direct_messages_box() function. * @@ -1292,17 +1281,6 @@ class ApiTest extends FixtureTest //self::assertArrayHasKey('direct_message', $result); } - /** - * Test the api_direct_messages_inbox() function. - * - * @return void - */ - public function testApiDirectMessagesInbox() - { - //$result = api_direct_messages_inbox('json'); - //self::assertArrayHasKey('direct_message', $result); - } - /** * Test the api_direct_messages_all() function. * diff --git a/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php b/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php new file mode 100644 index 0000000000..582729c8b9 --- /dev/null +++ b/tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php @@ -0,0 +1,38 @@ +loadFixture(__DIR__ . '/../../../../../datasets/mail/mail.fixture.php', DI::dba()); + + $directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser()); + + $destroy = new Inbox($directMessage, DI::dba(), DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET], ['extension' => 'json']); + $response = $destroy->run(); + + $json = $this->toJson($response); + + print_r($json); + + self::assertGreaterThan(0, count($json)); + + foreach ($json as $item) { + self::assertIsInt($item->id); + self::assertIsString($item->text); + } + } +}