Move DirectMessages/Inbox tests
This commit is contained in:
parent
0c4c6faa54
commit
e7c5bdc779
|
@ -1226,17 +1226,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 testApiDirectMessagesBoxWithInbox()
|
|
||||||
{
|
|
||||||
//$result = api_direct_messages_box('json', 'inbox', 'false');
|
|
||||||
//self::assertArrayHasKey('direct_message', $result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the api_direct_messages_box() function.
|
* Test the api_direct_messages_box() function.
|
||||||
*
|
*
|
||||||
|
@ -1292,17 +1281,6 @@ class ApiTest extends FixtureTest
|
||||||
//self::assertArrayHasKey('direct_message', $result);
|
//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.
|
* 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