Re-enable StatusNetConfig test

This commit is contained in:
Philipp 2021-12-04 21:58:09 +01:00
parent 43b32abe46
commit 902bcc506f
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432

View File

@ -2,29 +2,36 @@
namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial; namespace Friendica\Test\src\Module\Api\GnuSocial\GnuSocial;
use Friendica\App\Router;
use Friendica\DI;
use Friendica\Module\Api\GNUSocial\GNUSocial\Config;
use Friendica\Test\src\Module\Api\ApiTest; use Friendica\Test\src\Module\Api\ApiTest;
class ConfigTest extends ApiTest class ConfigTest extends ApiTest
{ {
/** /**
* Test the api_statusnet_config() function. * Test the api_statusnet_config() function.
*
* @return void
*/ */
public function testApiStatusnetConfig() public function testApiStatusnetConfig()
{ {
/* $config = new Config(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]);
$result = api_statusnet_config('json'); $response = $config->run();
self::assertEquals('localhost', $result['config']['site']['server']); $body = (string)$response->getBody();
self::assertEquals('default', $result['config']['site']['theme']);
self::assertEquals(DI::baseUrl() . '/images/friendica-64.png', $result['config']['site']['logo']); self::assertJson($body);
self::assertTrue($result['config']['site']['fancy']);
self::assertEquals('en', $result['config']['site']['language']); $json = json_decode($body);
self::assertEquals('UTC', $result['config']['site']['timezone']);
self::assertEquals(200000, $result['config']['site']['textlimit']); self::assertEquals(1, 1);
self::assertEquals('false', $result['config']['site']['private']);
self::assertEquals('false', $result['config']['site']['ssl']); self::assertEquals('localhost', $json->site->server);
self::assertEquals(30, $result['config']['site']['shorturllength']); self::assertEquals('frio', $json->site->theme);
*/ self::assertEquals(DI::baseUrl() . '/images/friendica-64.png', $json->site->logo);
self::assertTrue($json->site->fancy);
self::assertEquals('en', $json->site->language);
self::assertEquals('UTC', $json->site->timezone);
self::assertEquals(200000, $json->site->textlimit);
self::assertFalse($json->site->private);
self::assertEquals('always', $json->site->ssl);
} }
} }