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

@ -1215,17 +1215,6 @@ class ApiTest extends FixtureTest
//self::assertArrayHasKey('direct_message', $result); //self::assertArrayHasKey('direct_message', $result);
} }
/**
* Test the api_direct_messages_box() function.
*
* @return void
*/
public function testApiDirectMessagesBoxWithAll()
{
//$result = api_direct_messages_box('json', 'all', 'false');
//self::assertArrayHasKey('direct_message', $result);
}
/** /**
* Test the api_direct_messages_box() function. * Test the api_direct_messages_box() function.
* *
@ -1281,17 +1270,6 @@ class ApiTest extends FixtureTest
//self::assertArrayHasKey('direct_message', $result); //self::assertArrayHasKey('direct_message', $result);
} }
/**
* Test the api_direct_messages_all() function.
*
* @return void
*/
public function testApiDirectMessagesAll()
{
//$result = api_direct_messages_all('json');
//self::assertArrayHasKey('direct_message', $result);
}
/** /**
* Test the api_direct_messages_conversation() function. * Test the api_direct_messages_conversation() function.
* *

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); $json = $this->toJson($response);
print_r($json);
self::assertGreaterThan(0, count($json)); self::assertGreaterThan(0, count($json));
foreach ($json as $item) { foreach ($json as $item) {