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 $test = new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']);
15 $response = $test->run();
17 self::assertEquals(['Content-type' => ['application/json'], ICanCreateResponses::X_HEADER => ['json']], $response->getHeaders());
18 self::assertEquals('"ok"', $response->getBody());
21 public function testXml()
23 $test = new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']);
24 $response = $test->run();
26 self::assertEquals(['Content-type' => ['text/xml'], ICanCreateResponses::X_HEADER => ['xml']], $response->getHeaders());
27 self::assertxml($response->getBody(), 'ok');