From 93b0075a90a9bcad89d53413eb8445149d009027 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 18 Oct 2023 01:03:57 +0000 Subject: [PATCH] add invalid api function tests --- tests/Controller/ApiControllerTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 87a9b62..e171283 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -248,4 +248,14 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $this->module->apiChangeCommentVote($request, $response); self::assertEquals($vId, $response->getDataArray('')['response']->id); } + + public function testInvalidapiCommentUpdate() : void + { + $response = new HttpResponse(); + $request = new HttpRequest(new HttpUri('')); + + $request->header->account = 1; + $this->module->apiCommentUpdate($request, $response); + self::assertEquals(RequestStatusCode::R_400, $response->header->status); + } }