Files
e-ticket/tests/Controller/ScannerControllerTest.php
Serreau Jovann a544496104 Add PWA scanner app for organizers at /scanner
Standalone installable PWA with:
- JWT login via /api/auth/login
- Event list from /api/live/events
- QR code camera scanning (html5-qrcode library)
- Scan results with accepted/refused state and ticket details
- Auto token refresh on expiry
- Offline caching via service worker
- Dark theme optimized for outdoor scanning
- Vibration feedback on scan

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:04:56 +01:00

41 lines
1.2 KiB
PHP

<?php
namespace App\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ScannerControllerTest extends WebTestCase
{
public function testScannerPageReturnsSuccess(): void
{
$client = static::createClient();
$client->request('GET', '/scanner');
self::assertResponseIsSuccessful();
self::assertSelectorTextContains('title', 'E-Ticket Scanner');
}
public function testScannerManifestReturnsJson(): void
{
$client = static::createClient();
$client->request('GET', '/scanner/manifest.json');
self::assertResponseIsSuccessful();
self::assertResponseHeaderSame('Content-Type', 'application/manifest+json');
$data = json_decode($client->getResponse()->getContent(), true);
self::assertSame('E-Ticket Scanner', $data['name']);
self::assertSame('standalone', $data['display']);
self::assertSame('/scanner', $data['start_url']);
}
public function testScannerPageIsAccessibleWithoutAuth(): void
{
$client = static::createClient();
$client->request('GET', '/scanner');
self::assertResponseIsSuccessful();
self::assertResponseStatusCodeSame(200);
}
}