diff --git a/module/Core/test-api/Action/QrCodeTest.php b/module/Core/test-api/Action/QrCodeTest.php new file mode 100644 index 00000000..955e6c7e --- /dev/null +++ b/module/Core/test-api/Action/QrCodeTest.php @@ -0,0 +1,27 @@ +callShortUrl('custom/qr-code'); + self::assertEquals(200, $response->getStatusCode()); + + // This short URL allow max 2 visits + $this->callShortUrl('custom'); + $this->callShortUrl('custom'); + + // After 2 visits, the QR code should return a 404 + $response = $this->callShortUrl('custom/qr-code'); + self::assertEquals(404, $response->getStatusCode()); + } +}