mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Inherit ApiResponse
from Response
This commit is contained in:
parent
561aba18e3
commit
537b74f307
46 changed files with 326 additions and 277 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue