mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Add feedback - avoid intermediate variables
This commit is contained in:
parent
adf0d7bc95
commit
301ac83ebf
42 changed files with 367 additions and 272 deletions
|
@ -66,17 +66,20 @@ class NotificationTest extends ApiTest
|
|||
</notes>
|
||||
XML;
|
||||
|
||||
$notification = new Notification(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']);
|
||||
$response = $notification->run();
|
||||
$response = (new Notification(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'xml']))
|
||||
->run();
|
||||
|
||||
self::assertXmlStringEqualsXmlString($assertXml, (string)$response->getBody());
|
||||
self::assertEquals(['Content-type' => ['text/xml'], ICanCreateResponses::X_HEADER => ['xml']], $response->getHeaders());
|
||||
self::assertEquals([
|
||||
'Content-type' => ['text/xml'],
|
||||
ICanCreateResponses::X_HEADER => ['xml']
|
||||
], $response->getHeaders());
|
||||
}
|
||||
|
||||
public function testWithJsonResult()
|
||||
{
|
||||
$notification = new Notification(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']);
|
||||
$response = $notification->run();
|
||||
$response = (new Notification(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']))
|
||||
->run();
|
||||
|
||||
$json = $this->toJson($response);
|
||||
|
||||
|
@ -88,6 +91,9 @@ XML;
|
|||
self::assertIsString($note->msg);
|
||||
}
|
||||
|
||||
self::assertEquals(['Content-type' => ['application/json'], ICanCreateResponses::X_HEADER => ['json']], $response->getHeaders());
|
||||
self::assertEquals([
|
||||
'Content-type' => ['application/json'],
|
||||
ICanCreateResponses::X_HEADER => ['json']
|
||||
], $response->getHeaders());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue