From 744524fbe67c702cf0db67bea07833b03236509b Mon Sep 17 00:00:00 2001 From: grandeljay Date: Wed, 20 Sep 2023 17:33:41 +0200 Subject: [PATCH] test: add title over 128 chars --- tests/CreateWishTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/CreateWishTest.php b/tests/CreateWishTest.php index 41cd450a..d991b65f 100644 --- a/tests/CreateWishTest.php +++ b/tests/CreateWishTest.php @@ -45,6 +45,24 @@ final class CreateWishTest extends TestCase $this->assertEmpty($json['warning'], 'There has been unexpected output.'); } + public function testTitleOver128Chars(): void + { + $apiResponse = $this->apiRequest( + 'http://wishthis.online.localhost/api/wishes', + \CURLOPT_POST, + array( + 'wish_title' => '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890', + 'wishlist_id' => $this->testWishlistId, + ) + ); + $this->assertNotFalse($apiResponse); + + $json = \json_decode($apiResponse, true); + $this->assertNotNull($json); + $this->assertTrue($json['success']); + $this->assertEmpty($json['warning'], 'There has been unexpected output.'); + } + /** * Move this into a different testing class *