test: add url over 255 chars

This commit is contained in:
grandeljay 2023-09-20 17:44:38 +02:00
parent c8c257122d
commit ebfe5b34a2

View file

@ -51,7 +51,7 @@ final class CreateWishTest extends TestCase
'http://wishthis.online.localhost/api/wishes', 'http://wishthis.online.localhost/api/wishes',
\CURLOPT_POST, \CURLOPT_POST,
array( array(
'wish_title' => '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890', 'wish_title' => '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789',
'wishlist_id' => $this->testWishlistId, 'wishlist_id' => $this->testWishlistId,
) )
); );
@ -123,4 +123,22 @@ final class CreateWishTest extends TestCase
$this->assertTrue($json['success']); $this->assertTrue($json['success']);
$this->assertEmpty($json['warning'], 'There has been unexpected output.'); $this->assertEmpty($json['warning'], 'There has been unexpected output.');
} }
public function testUrlOver255Chars(): void
{
$apiResponse = $this->apiRequest(
'http://wishthis.online.localhost/api/wishes',
\CURLOPT_POST,
array(
'wish_url' => 'https://www.amazon.com/Red-SA500-NAS-NAND-Internal/dp/B07YFGG261?012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789',
'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.');
}
} }