mirror of
https://github.com/friendica/friendica
synced 2024-11-09 15:42:55 +00:00
Move DirectMessages/Inbox tests
This commit is contained in:
parent
0c4c6faa54
commit
e7c5bdc779
2 changed files with 38 additions and 22 deletions
|
@ -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.
|
||||
*
|
||||
|
|
38
tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php
Normal file
38
tests/src/Module/Api/Twitter/DirectMessages/InboxTest.php
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue