Inherit ApiResponse from Response

This commit is contained in:
Philipp 2021-11-21 21:52:36 +01:00
parent 561aba18e3
commit 537b74f307
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
46 changed files with 326 additions and 277 deletions

View file

@ -5,23 +5,22 @@ namespace Friendica\Test\src\Module\Api\GnuSocial\Help;
use Friendica\DI;
use Friendica\Module\Api\GNUSocial\Help\Test;
use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble;
class TestTest extends ApiTest
{
public function testJson()
{
$test = new Test(DI::l10n(), ['extension' => 'json']);
$test->rawContent();
$test = new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']);
$response = $test->run();
self::assertEquals('"ok"', ApiResponseDouble::getOutput());
self::assertEquals('"ok"', $response->getContent());
}
public function testXml()
{
$test = new Test(DI::l10n(), ['extension' => 'xml']);
$test->rawContent();
$test = new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']);
$response = $test->run();
self::assertxml(ApiResponseDouble::getOutput(), 'ok');
self::assertxml($response->getContent(), 'ok');
}
}