Move DirectMessages/Inbox tests

This commit is contained in:
Philipp 2021-12-30 20:02:53 +01:00
parent 0c4c6faa54
commit e7c5bdc779
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
2 changed files with 38 additions and 22 deletions

View file

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

View file

@ -0,0 +1,38 @@
<?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\Inbox;
use Friendica\Test\src\Module\Api\ApiTest;
class InboxTest extends ApiTest
{
/**
* Test the api_direct_messages_box() function.
*
* @return void
*/
public function testApiDirectMessagesBoxWithInbox()
{
$this->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);
}
}
}