]> git.mxchange.org Git - friendica.git/commitdiff
Add assertions for NotificationTest
authorPhilipp <admin@philipp.info>
Fri, 10 Dec 2021 16:32:41 +0000 (17:32 +0100)
committerPhilipp <admin@philipp.info>
Fri, 10 Dec 2021 16:32:41 +0000 (17:32 +0100)
tests/src/Module/Api/Friendica/NotificationTest.php

index c9ab001418cc2dfb56d63022c6ed7ab6606fa424..f05387bd88e01fa49b340e9297e62aeac95d5798 100644 (file)
@@ -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());
        }