Inherit ApiResponse from Response
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user