Re enable Blocks/Lists test

This commit is contained in:
Philipp Holzer 2021-12-04 23:24:56 +01:00
parent 6b03ee2922
commit 7ca47e8d21
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
3 changed files with 17 additions and 16 deletions

View file

@ -87,6 +87,6 @@ class Lists extends ContactEndpoint
self::setLinkHeader();
System::jsonExit($return);
$this->response->exit('lists', ['lists' => $return]);
}
}

View file

@ -2,6 +2,7 @@
namespace Friendica\Test\src\Module\Api\Twitter\Account;
use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI;
use Friendica\Module\Api\Twitter\Account\RateLimitStatus;
@ -11,7 +12,7 @@ class RateLimitStatusTest extends ApiTest
{
public function testWithJson()
{
$rateLimitStatus = new RateLimitStatus(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']);
$rateLimitStatus = new RateLimitStatus(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET], ['extension' => 'json']);
$response = $rateLimitStatus->run();
$result = json_decode($response->getBody());

View file

@ -2,30 +2,28 @@
namespace Friendica\Test\src\Module\Api\Twitter\Blocks;
use Friendica\App\Router;
use Friendica\DI;
use Friendica\Module\Api\Twitter\Blocks\Lists;
use Friendica\Test\src\Module\Api\ApiTest;
class ListsTest extends ApiTest
{
/**
* Test the api_statuses_f() function.
*
* @return void
*/
public function testApiStatusesFWithBlocks()
{
// $result = api_statuses_f('blocks');
// self::assertArrayHasKey('user', $result);
}
$lists = new Lists(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]);
$response = $lists->run();
/**
* Test the api_blocks_list() function.
*
* @return void
*/
public function testApiBlocksList()
{
// $result = api_blocks_list('json');
// self::assertArrayHasKey('user', $result);
$body = (string)$response->getBody();
self::assertJson($body);
$json = json_decode($body);
self::assertIsArray($json->users);
}
/**
@ -35,6 +33,8 @@ class ListsTest extends ApiTest
*/
public function testApiBlocksListWithUndefinedCursor()
{
self::markTestIncomplete('Needs refactoring of Lists - replace filter_input() with $request parameter checks');
// $_GET['cursor'] = 'undefined';
// self::assertFalse(api_blocks_list('json'));
}