Add homepage, tarifs, legal pages, navbar, footer and full test coverage
- Homepage: hero, how it works (buyer/organizer), features, CTA
- Tarifs: 3 plans (Gratuit, Basique 10€, Sur-mesure), JSON-LD Product
- Legal pages: mentions legales, CGU (tabs buyer/organizer), CGV, RGPD, cookies, hosting
- Navbar: neubrutalism style, logo liip, mobile menu, SEO attributes
- Footer: contact, description, legal links, tarifs
- Sitemap: add /tarifs and /sitemap-orgas-{page}.xml
- Liip Imagine: remove S3, webp format on all filters
- Tests: full coverage for all controllers, services, repositories
- Fix CSP: replace inline onclick with data-tab JS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 00:01:58 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Tests\Controller;
|
|
|
|
|
|
Add comprehensive test coverage for AttestationController, LegalController, AdminController, AccountController and AnalyticsEvent entity
- AttestationController: fix decodeAndVerifyHash to have max 3 returns, add 11 tests covering all routes (check, ventesRef, ventes) and all decodeAndVerifyHash branches (invalid base64, missing pipe, bad signature, bad JSON, valid hash with/without registered attestation), plus generateHash unit tests with unicode
- LegalController: add 6 tests for RGPD POST routes (rgpdAccess and rgpdDeletion) covering empty fields, data found, and no data found scenarios
- AdminController: add 10 tests for analytics page (all period filters + access denied) and orderTickets endpoint (single ticket PDF, multiple tickets ZIP, order not found, no tickets)
- AccountController: add 17 tests for downloadTicket (success/denied/404), resendTicket (success/denied/404), cancelTicket (success/denied/404), createAccreditation (staff/exposant/empty fields/no categories/invalid type), eventAttestation (with categories/billets/empty selection)
- AnalyticsEvent entity: new test file with 8 tests covering constructor defaults, all getters/setters, nullable fields, and fluent interface
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 18:41:18 +02:00
|
|
|
use App\Service\RgpdService;
|
Add homepage, tarifs, legal pages, navbar, footer and full test coverage
- Homepage: hero, how it works (buyer/organizer), features, CTA
- Tarifs: 3 plans (Gratuit, Basique 10€, Sur-mesure), JSON-LD Product
- Legal pages: mentions legales, CGU (tabs buyer/organizer), CGV, RGPD, cookies, hosting
- Navbar: neubrutalism style, logo liip, mobile menu, SEO attributes
- Footer: contact, description, legal links, tarifs
- Sitemap: add /tarifs and /sitemap-orgas-{page}.xml
- Liip Imagine: remove S3, webp format on all filters
- Tests: full coverage for all controllers, services, repositories
- Fix CSP: replace inline onclick with data-tab JS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 00:01:58 +01:00
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
|
|
|
|
|
|
|
|
class LegalControllerTest extends WebTestCase
|
|
|
|
|
{
|
|
|
|
|
public function testMentionsLegales(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/mentions-legales');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testCgu(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/cgu');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testCgv(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/cgv');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testHosting(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/hebergement');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testCookies(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/cookies');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testRgpd(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/rgpd');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
2026-03-19 14:25:04 +01:00
|
|
|
|
|
|
|
|
public function testConformite(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/conformite');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
Add comprehensive test coverage for AttestationController, LegalController, AdminController, AccountController and AnalyticsEvent entity
- AttestationController: fix decodeAndVerifyHash to have max 3 returns, add 11 tests covering all routes (check, ventesRef, ventes) and all decodeAndVerifyHash branches (invalid base64, missing pipe, bad signature, bad JSON, valid hash with/without registered attestation), plus generateHash unit tests with unicode
- LegalController: add 6 tests for RGPD POST routes (rgpdAccess and rgpdDeletion) covering empty fields, data found, and no data found scenarios
- AdminController: add 10 tests for analytics page (all period filters + access denied) and orderTickets endpoint (single ticket PDF, multiple tickets ZIP, order not found, no tickets)
- AccountController: add 17 tests for downloadTicket (success/denied/404), resendTicket (success/denied/404), cancelTicket (success/denied/404), createAccreditation (staff/exposant/empty fields/no categories/invalid type), eventAttestation (with categories/billets/empty selection)
- AnalyticsEvent entity: new test file with 8 tests covering constructor defaults, all getters/setters, nullable fields, and fluent interface
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 18:41:18 +02:00
|
|
|
|
|
|
|
|
public function testRgpdAccessEmptyFields(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('POST', '/rgpd/acces', ['ip' => '', 'email' => '']);
|
|
|
|
|
|
|
|
|
|
self::assertResponseRedirects('/rgpd');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testRgpdAccessWithDataFound(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
|
|
|
|
|
$mock = $this->createMock(RgpdService::class);
|
|
|
|
|
$mock->method('handleAccessRequest')
|
|
|
|
|
->with('192.168.1.1', 'test@example.com')
|
|
|
|
|
->willReturn(['found' => true, 'count' => 5]);
|
|
|
|
|
|
|
|
|
|
static::getContainer()->set(RgpdService::class, $mock);
|
|
|
|
|
|
|
|
|
|
$client->request('POST', '/rgpd/acces', ['ip' => '192.168.1.1', 'email' => 'test@example.com']);
|
|
|
|
|
|
|
|
|
|
self::assertResponseRedirects('/rgpd');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testRgpdAccessWithNoData(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
|
|
|
|
|
$mock = $this->createMock(RgpdService::class);
|
|
|
|
|
$mock->method('handleAccessRequest')
|
|
|
|
|
->with('192.168.1.1', 'test@example.com')
|
|
|
|
|
->willReturn(['found' => false, 'count' => 0]);
|
|
|
|
|
|
|
|
|
|
static::getContainer()->set(RgpdService::class, $mock);
|
|
|
|
|
|
|
|
|
|
$client->request('POST', '/rgpd/acces', ['ip' => '192.168.1.1', 'email' => 'test@example.com']);
|
|
|
|
|
|
|
|
|
|
self::assertResponseRedirects('/rgpd');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testRgpdDeletionEmptyFields(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('POST', '/rgpd/suppression', ['ip' => '', 'email' => '']);
|
|
|
|
|
|
|
|
|
|
self::assertResponseRedirects('/rgpd');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testRgpdDeletionWithDataFound(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
|
|
|
|
|
$mock = $this->createMock(RgpdService::class);
|
|
|
|
|
$mock->method('handleDeletionRequest')
|
|
|
|
|
->with('192.168.1.1', 'test@example.com')
|
|
|
|
|
->willReturn(['found' => true, 'count' => 3]);
|
|
|
|
|
|
|
|
|
|
static::getContainer()->set(RgpdService::class, $mock);
|
|
|
|
|
|
|
|
|
|
$client->request('POST', '/rgpd/suppression', ['ip' => '192.168.1.1', 'email' => 'test@example.com']);
|
|
|
|
|
|
|
|
|
|
self::assertResponseRedirects('/rgpd');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testRgpdDeletionWithNoData(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
|
|
|
|
|
$mock = $this->createMock(RgpdService::class);
|
|
|
|
|
$mock->method('handleDeletionRequest')
|
|
|
|
|
->with('192.168.1.1', 'test@example.com')
|
|
|
|
|
->willReturn(['found' => false, 'count' => 0]);
|
|
|
|
|
|
|
|
|
|
static::getContainer()->set(RgpdService::class, $mock);
|
|
|
|
|
|
|
|
|
|
$client->request('POST', '/rgpd/suppression', ['ip' => '192.168.1.1', 'email' => 'test@example.com']);
|
|
|
|
|
|
|
|
|
|
self::assertResponseRedirects('/rgpd');
|
|
|
|
|
}
|
Add homepage, tarifs, legal pages, navbar, footer and full test coverage
- Homepage: hero, how it works (buyer/organizer), features, CTA
- Tarifs: 3 plans (Gratuit, Basique 10€, Sur-mesure), JSON-LD Product
- Legal pages: mentions legales, CGU (tabs buyer/organizer), CGV, RGPD, cookies, hosting
- Navbar: neubrutalism style, logo liip, mobile menu, SEO attributes
- Footer: contact, description, legal links, tarifs
- Sitemap: add /tarifs and /sitemap-orgas-{page}.xml
- Liip Imagine: remove S3, webp format on all filters
- Tests: full coverage for all controllers, services, repositories
- Fix CSP: replace inline onclick with data-tab JS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 00:01:58 +01:00
|
|
|
}
|