From f6e09204e9a2d0d9f5c8ef7a1e5b5c725a8ad1a4 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 10 Dec 2021 17:32:41 +0100 Subject: [PATCH] Add assertions for NotificationTest --- tests/src/Module/Api/Friendica/NotificationTest.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/src/Module/Api/Friendica/NotificationTest.php b/tests/src/Module/Api/Friendica/NotificationTest.php index c9ab001418..f05387bd88 100644 --- a/tests/src/Module/Api/Friendica/NotificationTest.php +++ b/tests/src/Module/Api/Friendica/NotificationTest.php @@ -78,7 +78,15 @@ XML; $notification = new Notification(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), [], ['extension' => 'json']); $response = $notification->run(); - $this->toJson($response); + $json = $this->toJson($response); + + self::assertIsArray($json); + + foreach ($json as $note) { + self::assertIsInt($note->id); + self::assertIsInt($note->uid); + self::assertIsString($note->msg); + } self::assertEquals(['Content-type' => ['application/json'], ICanCreateResponses::X_HEADER => ['json']], $response->getHeaders()); }