mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-07 15:54:26 +02:00
Replace IRespondToRequests with PSR-7 ResponseInterface
This commit is contained in:
parent
ca5c40c97e
commit
7cd85873ee
17 changed files with 96 additions and 92 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Friendica\Test\src\Module;
|
||||
|
||||
use Friendica\Capabilities\IRespondToRequests;
|
||||
use Friendica\DI;
|
||||
use Friendica\Module\NodeInfo110;
|
||||
use Friendica\Module\NodeInfo120;
|
||||
|
@ -19,11 +18,10 @@ class NodeInfoTest extends FixtureTest
|
|||
$nodeinfo = new NodeInfo110(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), $response, DI::config(), []);
|
||||
$response = $nodeinfo->run();
|
||||
|
||||
self::assertEquals(IRespondToRequests::TYPE_JSON, $response->getType());
|
||||
self::assertJson($response->getContent());
|
||||
self::assertEquals(['Content-type' => 'application/json'], $response->getHeaders());
|
||||
self::assertJson($response->getBody());
|
||||
self::assertEquals(['Content-type' => ['application/json']], $response->getHeaders());
|
||||
|
||||
$json = json_decode($response->getContent());
|
||||
$json = json_decode($response->getBody());
|
||||
|
||||
self::assertEquals('1.0', $json->version);
|
||||
|
||||
|
@ -43,11 +41,10 @@ class NodeInfoTest extends FixtureTest
|
|||
$nodeinfo = new NodeInfo120(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), $response, DI::config(), []);
|
||||
$response = $nodeinfo->run();
|
||||
|
||||
self::assertEquals(IRespondToRequests::TYPE_JSON, $response->getType());
|
||||
self::assertJson($response->getContent());
|
||||
self::assertEquals(['Content-type' => 'application/json; charset=utf-8'], $response->getHeaders());
|
||||
self::assertJson($response->getBody());
|
||||
self::assertEquals(['Content-type' => ['application/json; charset=utf-8']], $response->getHeaders());
|
||||
|
||||
$json = json_decode($response->getContent());
|
||||
$json = json_decode($response->getBody());
|
||||
|
||||
self::assertEquals('2.0', $json->version);
|
||||
|
||||
|
@ -66,11 +63,10 @@ class NodeInfoTest extends FixtureTest
|
|||
$nodeinfo = new NodeInfo210(DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), $response, DI::config(), []);
|
||||
$response = $nodeinfo->run();
|
||||
|
||||
self::assertEquals(IRespondToRequests::TYPE_JSON, $response->getType());
|
||||
self::assertJson($response->getContent());
|
||||
self::assertEquals(['Content-type' => 'application/json; charset=utf-8'], $response->getHeaders());
|
||||
self::assertJson($response->getBody());
|
||||
self::assertEquals(['Content-type' => ['application/json; charset=utf-8']], $response->getHeaders());
|
||||
|
||||
$json = json_decode($response->getContent());
|
||||
$json = json_decode($response->getBody());
|
||||
|
||||
self::assertEquals('1.0', $json->version);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue