mirror of
https://github.com/friendica/friendica
synced 2024-12-23 05:20:15 +00:00
Move DirectMessages/All tests
This commit is contained in:
parent
e7c5bdc779
commit
95e3583c68
3 changed files with 36 additions and 24 deletions
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
36
tests/src/Module/Api/Twitter/DirectMessages/AllTest.php
Normal file
36
tests/src/Module/Api/Twitter/DirectMessages/AllTest.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue