3 namespace Friendica\Test\src\Module\Api\GnuSocial\Help;
5 use Friendica\Capabilities\ICanCreateResponses;
7 use Friendica\Module\Api\GNUSocial\Help\Test;
8 use Friendica\Test\src\Module\Api\ApiTest;
10 class TestTest extends ApiTest
12 public function testJson()
14 $response = (new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
17 $json = $this->toJson($response);
20 'Content-type' => ['application/json'],
21 ICanCreateResponses::X_HEADER => ['json']
22 ], $response->getHeaders());
23 self::assertEquals('ok', $json);
26 public function testXml()
28 $response = (new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']))
32 'Content-type' => ['text/xml'],
33 ICanCreateResponses::X_HEADER => ['xml']
34 ], $response->getHeaders());
35 self::assertxml($response->getBody(), 'ok');