Files
e-ticket/tests/Controller/ScannerControllerTest.php
Serreau Jovann 822bf8915f Scanner: SSO login, 2 scan modes (camera/security key), sound feedback, order details, force validation, staff/exposant badges
- Add SSO login button to scanner PWA with Keycloak redirect flow via session state
- Add manual scan mode via security key (16 chars) alongside QR camera scan
- Add audio feedback: good (accepted), warning (already scanned), refused sounds
- Add unique scan counter per reference (no double counting same ticket)
- Add order details display in scan results (order number, email, total, items)
- Add force validation button for refused tickets (organizer/ROLE_ROOT only), sends email notification
- Add already_scanned warning only for same-day scans, exit_definitive only same day
- Staff and exposant tickets always validate regardless of state

API: ROLE_ROOT access to all events, categories, billets, and scan endpoints

- ROLE_ROOT bypasses ownership checks on all /api/live/* endpoints
- ROLE_ROOT can login via API (email/password and SSO)
- Scan API accepts securityKey parameter in addition to reference
- Scan response includes billetType, buyerEmail, and full order details with items

Event management: tickets tab, staff/exposant accreditations, attestation PDF

- Add Tickets tab listing all sold tickets with search, download PDF, resend email, cancel actions
- Add Staff/Exposant accreditation form in Invitations tab, generates dedicated non-buyable billet
- Add Attestation tab to generate sales certificate PDF with category/billet selection
- PDF billet template shows STAFF/EXPOSANT badge with distinct colors (black/purple)
- Exclude invitations from all financial stats (event stats, admin dashboard, organizer finances)
- Fix sold counts to exclude invitations in categories recap
- Use actual Stripe fee parameters instead of hardcoded values in commission calculations
- Add commission detail breakdown (E-Ticket + Stripe) in categories and stats tabs

Admin: download tickets for orders

- Add download button on admin orders page (single PDF or ZIP for multiple tickets)

Scanner PWA fixes: CSP (unpkg -> jsdelivr), service worker scope (/scanner/)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:50:42 +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);
}
}