mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-11 22:14:25 +02:00
Simplify json testing
This commit is contained in:
parent
6a813eec92
commit
354c2d828a
17 changed files with 45 additions and 66 deletions
|
@ -19,13 +19,8 @@ class ConfigTest extends ApiTest
|
|||
|
||||
$config = new Config(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]);
|
||||
$response = $config->run();
|
||||
$body = (string)$response->getBody();
|
||||
|
||||
self::assertJson($body);
|
||||
|
||||
$json = json_decode($body);
|
||||
|
||||
self::assertEquals(1, 1);
|
||||
$json = $this->toJson($response);
|
||||
|
||||
self::assertEquals('localhost', $json->site->server);
|
||||
self::assertEquals('frio', $json->site->theme);
|
||||
|
|
|
@ -14,8 +14,10 @@ class TestTest extends ApiTest
|
|||
$test = new Test(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']);
|
||||
$response = $test->run();
|
||||
|
||||
$json = $this->toJson($response);
|
||||
|
||||
self::assertEquals(['Content-type' => ['application/json'], ICanCreateResponses::X_HEADER => ['json']], $response->getHeaders());
|
||||
self::assertEquals('"ok"', $response->getBody());
|
||||
self::assertEquals('ok', $json);
|
||||
}
|
||||
|
||||
public function testXml()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue