Move DirectMessages/All tests

This commit is contained in:
Philipp 2021-12-30 20:04:32 +01:00
parent e7c5bdc779
commit 95e3583c68
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
3 changed files with 36 additions and 24 deletions

View file

@ -0,0 +1,36 @@
<?php
namespace Friendica\Test\src\Module\Api\Twitter\DirectMessages;
use Friendica\App\Router;
use Friendica\DI;
use Friendica\Module\Api\Twitter\DirectMessages\All;
use Friendica\Factory\Api\Twitter\DirectMessage;
use Friendica\Test\src\Module\Api\ApiTest;
class AllTest extends ApiTest
{
/**
* Test the api_direct_messages_box() function.
*
* @return void
*/
public function testApiDirectMessagesBoxWithAll()
{
$this->loadFixture(__DIR__ . '/../../../../../datasets/mail/mail.fixture.php', DI::dba());
$directMessage = new DirectMessage(DI::logger(), DI::dba(), DI::twitterUser());
$destroy = new All($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);
self::assertGreaterThan(0, count($json));
foreach ($json as $item) {
self::assertIsInt($item->id);
self::assertIsString($item->text);
}
}
}

View file

@ -26,8 +26,6 @@ class InboxTest extends ApiTest
$json = $this->toJson($response);
print_r($json);
self::assertGreaterThan(0, count($json));
foreach ($json as $item) {