mirror of
https://github.com/friendica/friendica
synced 2024-11-09 23:02:54 +00:00
Reenable Incoming test and fixes an array_reverse() bug
This commit is contained in:
parent
6d8b8d95b1
commit
85b9f2b02c
3 changed files with 16 additions and 6 deletions
|
@ -86,6 +86,6 @@ class Incoming extends ContactEndpoint
|
|||
|
||||
self::setLinkHeader();
|
||||
|
||||
System::jsonExit($return);
|
||||
$this->response->exit('incoming', ['incoming' => $return]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,6 @@ class ListsTest extends ApiTest
|
|||
$json = json_decode($body);
|
||||
|
||||
self::assertIsArray($json->users);
|
||||
|
||||
// $result = api_statuses_f('friends');
|
||||
// self::assertArrayHasKey('user', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace Friendica\Test\src\Module\Api\Twitter\Friendships;
|
||||
|
||||
use Friendica\App\Router;
|
||||
use Friendica\DI;
|
||||
use Friendica\Module\Api\Twitter\Friendships\Incoming;
|
||||
use Friendica\Test\src\Module\Api\ApiTest;
|
||||
|
||||
class IncomingTest extends ApiTest
|
||||
|
@ -13,8 +16,16 @@ class IncomingTest extends ApiTest
|
|||
*/
|
||||
public function testApiFriendshipsIncoming()
|
||||
{
|
||||
// $result = api_friendships_incoming('json');
|
||||
// self::assertArrayHasKey('id', $result);
|
||||
$lists = new Incoming(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]);
|
||||
$response = $lists->run();
|
||||
|
||||
$body = (string)$response->getBody();
|
||||
|
||||
self::assertJson($body);
|
||||
|
||||
$json = json_decode($body);
|
||||
|
||||
self::assertIsArray($json->ids);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,6 +35,8 @@ class IncomingTest extends ApiTest
|
|||
*/
|
||||
public function testApiFriendshipsIncomingWithUndefinedCursor()
|
||||
{
|
||||
self::markTestIncomplete('Needs refactoring of Incoming - replace filter_input() with $request parameter checks');
|
||||
|
||||
// $_GET['cursor'] = 'undefined';
|
||||
// self::assertFalse(api_friendships_incoming('json'));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue