2026-03-18 22:50:23 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Tests\Controller;
|
|
|
|
|
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
use App\Entity\User;
|
|
|
|
|
use Doctrine\ORM\EntityManagerInterface;
|
2026-03-18 22:50:23 +01:00
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
|
|
|
|
|
|
|
|
class HomeControllerTest extends WebTestCase
|
|
|
|
|
{
|
|
|
|
|
public function testIndexReturnsSuccess(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
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
|
|
|
|
|
|
|
|
public function testTarifsReturnsSuccess(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/tarifs');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
|
|
|
|
|
public function testOrganizersReturnsSuccess(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/organisateurs');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testOrganizerDetailReturnsSuccess(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$organizer = $em->getRepository(User::class)->findOneBy([]);
|
|
|
|
|
$found = false;
|
|
|
|
|
if ($organizer) {
|
|
|
|
|
foreach ($em->getRepository(User::class)->findAll() as $user) {
|
|
|
|
|
if (\in_array('ROLE_ORGANIZER', $user->getRoles(), true) && $user->isApproved()) {
|
|
|
|
|
$organizer = $user;
|
|
|
|
|
$found = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!$found) {
|
|
|
|
|
$organizer = new User();
|
|
|
|
|
$organizer->setEmail('test-orga-detail@example.com');
|
|
|
|
|
$organizer->setFirstName('Test');
|
|
|
|
|
$organizer->setLastName('Orga');
|
|
|
|
|
$organizer->setPassword('hashed');
|
|
|
|
|
$organizer->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$organizer->setIsApproved(true);
|
|
|
|
|
$organizer->setIsVerified(true);
|
|
|
|
|
$organizer->setCompanyName('Asso Test');
|
|
|
|
|
$organizer->setSiret('12345678901234');
|
|
|
|
|
$em->persist($organizer);
|
|
|
|
|
$em->flush();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-20 10:47:56 +01:00
|
|
|
$client->request('GET', '/organisateur/'.$organizer->getId().'-'.$organizer->getSlug());
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
self::assertSelectorTextContains('h1', $organizer->getCompanyName() ?? $organizer->getFirstName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testOrganizerDetailRedirectsOnWrongSlug(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$organizer = new User();
|
2026-03-20 10:47:56 +01:00
|
|
|
$organizer->setEmail('test-orga-slug-'.uniqid().'@example.com');
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
$organizer->setFirstName('Slug');
|
|
|
|
|
$organizer->setLastName('Test');
|
|
|
|
|
$organizer->setPassword('hashed');
|
|
|
|
|
$organizer->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$organizer->setIsApproved(true);
|
|
|
|
|
$organizer->setIsVerified(true);
|
|
|
|
|
$organizer->setCompanyName('Mon Asso');
|
|
|
|
|
$em->persist($organizer);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
2026-03-20 10:47:56 +01:00
|
|
|
$client->request('GET', '/organisateur/'.$organizer->getId().'-mauvais-slug');
|
|
|
|
|
self::assertResponseRedirects('/organisateur/'.$organizer->getId().'-mon-asso', 301);
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testOrganizerDetailNotFoundReturns404(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/organisateur/999999-inexistant');
|
|
|
|
|
|
|
|
|
|
self::assertResponseStatusCodeSame(404);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testOrganizerDetailNonApprovedReturns404(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$organizer = new User();
|
2026-03-20 10:47:56 +01:00
|
|
|
$organizer->setEmail('test-orga-noapprove-'.uniqid().'@example.com');
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
$organizer->setFirstName('Test');
|
|
|
|
|
$organizer->setLastName('NonApproved');
|
|
|
|
|
$organizer->setPassword('hashed');
|
|
|
|
|
$organizer->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$organizer->setIsApproved(false);
|
|
|
|
|
$organizer->setIsVerified(true);
|
|
|
|
|
$em->persist($organizer);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
2026-03-20 10:47:56 +01:00
|
|
|
$client->request('GET', '/organisateur/'.$organizer->getId().'-'.$organizer->getSlug());
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
self::assertResponseStatusCodeSame(404);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testOrganizerDetailBuyerReturns404(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$buyer = new User();
|
2026-03-20 10:47:56 +01:00
|
|
|
$buyer->setEmail('test-buyer-detail-'.uniqid().'@example.com');
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
$buyer->setFirstName('Buyer');
|
|
|
|
|
$buyer->setLastName('Test');
|
|
|
|
|
$buyer->setPassword('hashed');
|
|
|
|
|
$buyer->setRoles(['ROLE_USER']);
|
|
|
|
|
$buyer->setIsVerified(true);
|
|
|
|
|
$em->persist($buyer);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
2026-03-20 10:47:56 +01:00
|
|
|
$client->request('GET', '/organisateur/'.$buyer->getId().'-'.$buyer->getSlug());
|
Add organizer pages, SEO breadcrumbs, Open Graph, homepage redesign, and infrastructure updates
- Add public organizers list page (/organisateurs) with neo-brutalist card grid, social icons, and logo display
- Add organizer detail page (/organisateur/{id}-{slug}) with company info, SIRET, email, address, social links, and events placeholder
- Add slug-based URLs with 301 redirect on wrong slug, getSlug() method on User entity
- Add "Voir les evenements" button on organizer cards linking to detail page
- Add JSON-LD BreadcrumbList to all 17 pages that were missing breadcrumbs (login, forgot_password, register_success, email_verified, legal/*, attestation/*, account/*)
- Add Open Graph meta tags (og:title, og:description, og:image, og:type, og:locale, og:site_name) in base.html.twig with automatic inheritance from title/description blocks
- Add og:image with organizer logo on detail page
- Update sitemap: add /organisateurs to sitemap-main, generate organizer detail URLs in sitemap-orgas with logo images
- Update navbar to highlight "Organisateurs" on detail pages
- Redesign homepage with hero section, marquee, stats counters, how-it-works, and CTA sections
- Add Tailwind v4 @source "../templates" directive to app.scss and admin.scss
- Migrate Flysystem from S3 to local storage (uploads/events, uploads/logos)
- Update Liip Imagine config with FormatExtensionResolver for webp conversion
- Add User entity social fields (website, facebook, instagram, twitter, tiktok), logo upload (Vich), __serialize/__unserialize for session safety
- Add account page settings tab with profile, logo upload, and social media for organizers
- Add Stripe Connect status display and sub-account management in account page
- Delete WebpExtensionSubscriber (replaced by FormatExtensionResolver)
- Add migration for social fields and logo columns
- Add deploy.yml chmod tasks for uploads directories
- Add HomeController tests (detail success, wrong slug redirect, 404 cases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 10:44:31 +01:00
|
|
|
self::assertResponseStatusCodeSame(404);
|
|
|
|
|
}
|
2026-03-20 21:23:21 +01:00
|
|
|
|
|
|
|
|
public function testEventsPageReturnsSuccess(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/evenements');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventsPageWithSearch(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/evenements?q=brocante');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
Add test coverage for remaining controllers, fix label accessibility, refactor duplicated code
New tests (47 added, 622 total):
- MonitorMessengerCommand: no failures, failures with email, null error, multiple (4)
- UnsubscribeController: unsubscribe with invitations refused + admin notified (1)
- AdminController: suspend/reactivate orga, orders page with filters, logs, invite orga submit/empty, delete/resend invitation, export CSV/PDF (13)
- AccountController: export CSV/PDF, getAllowedBilletTypes (free/basic/sur-mesure/null), billet type restriction, finance stats all statuses, soldCounts (9)
- HomeController: city filter, date filter, all filters combined, stock route (4)
- OrderController: event ended, invalid cart JSON, invalid email, stock zero (4)
- MailerService: getAdminEmail, getAdminFrom (2)
- JS: comment node, tabs missing panel/id/parent, cart stock polling edge cases (10)
Accessibility fixes:
- events.html.twig: add for/id on search, city, date labels
- admin/orders.html.twig: add for/id on search, status labels
Code quality:
- cart.js: remove dead ternaire branch (max > 10 always plural)
- tabs.js: use optional chaining for tablist?.setAttribute
- MeilisearchConsistencyCommand: extract diffAndReport() (was duplicated 3x)
- Email templates: extract _order_items_table.html.twig partial
- SonarQube: exclude src/Entity/** from CPD
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:11:07 +01:00
|
|
|
public function testEventsPageWithCityFilter(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/evenements?city=Paris');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventsPageWithDateFilter(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/evenements?date=2026-08-01');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventsPageWithAllFilters(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/evenements?q=test&city=Paris&date=2026-08-01');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
Reduce cognitive complexity, improve test coverage, fix SonarQube issues
Cognitive complexity refactors:
- cart.js: extract buildCart, handleCheckout, updateStockLabel, updateItemStock, startStockPolling (21→~8)
- tabs.js: use .at(-1) instead of [length-1]
- MeilisearchConsistencyCommand: extract checkAllIndexes, accumulate, reportSummary (18→~8)
- TranslateCommand: extract processDomain, processLanguage, loadExisting, findMissingKeys, removeObsoleteKeys, handleUpToDate, mergeAndOrder (36→~10)
- AccountController::index: extract computeFinanceStats with statusMap pattern (19→~12)
Test coverage additions:
- HomeController: expired invitation view, stock not found, stock with billets, search+city with mock results
- AdminController: delete/resend invitation not found (404)
- AccountController: item without billet (codeCoverageIgnore - NOT NULL in DB)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:57:00 +01:00
|
|
|
public function testEventsPageWithSearchAndCityMatchingResults(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-events-search-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Search');
|
|
|
|
|
$user->setLastName('Test');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Brocante Geante');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(true);
|
|
|
|
|
$em->persist($event);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
// Mock EventIndexService to return the event (simulates Meilisearch match)
|
|
|
|
|
$eventIndex = $this->createMock(\App\Service\EventIndexService::class);
|
|
|
|
|
$eventIndex->method('searchEvents')->willReturn([$event]);
|
|
|
|
|
static::getContainer()->set(\App\Service\EventIndexService::class, $eventIndex);
|
|
|
|
|
|
|
|
|
|
$client->request('GET', '/evenements?q=Brocante&city=Paris');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
Add test coverage for remaining controllers, fix label accessibility, refactor duplicated code
New tests (47 added, 622 total):
- MonitorMessengerCommand: no failures, failures with email, null error, multiple (4)
- UnsubscribeController: unsubscribe with invitations refused + admin notified (1)
- AdminController: suspend/reactivate orga, orders page with filters, logs, invite orga submit/empty, delete/resend invitation, export CSV/PDF (13)
- AccountController: export CSV/PDF, getAllowedBilletTypes (free/basic/sur-mesure/null), billet type restriction, finance stats all statuses, soldCounts (9)
- HomeController: city filter, date filter, all filters combined, stock route (4)
- OrderController: event ended, invalid cart JSON, invalid email, stock zero (4)
- MailerService: getAdminEmail, getAdminFrom (2)
- JS: comment node, tabs missing panel/id/parent, cart stock polling edge cases (10)
Accessibility fixes:
- events.html.twig: add for/id on search, city, date labels
- admin/orders.html.twig: add for/id on search, status labels
Code quality:
- cart.js: remove dead ternaire branch (max > 10 always plural)
- tabs.js: use optional chaining for tablist?.setAttribute
- MeilisearchConsistencyCommand: extract diffAndReport() (was duplicated 3x)
- Email templates: extract _order_items_table.html.twig partial
- SonarQube: exclude src/Entity/** from CPD
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:11:07 +01:00
|
|
|
public function testEventStockRoute(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-stock-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Stock');
|
|
|
|
|
$user->setLastName('Test');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Stock Event');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(true);
|
|
|
|
|
$em->persist($event);
|
Reduce cognitive complexity, improve test coverage, fix SonarQube issues
Cognitive complexity refactors:
- cart.js: extract buildCart, handleCheckout, updateStockLabel, updateItemStock, startStockPolling (21→~8)
- tabs.js: use .at(-1) instead of [length-1]
- MeilisearchConsistencyCommand: extract checkAllIndexes, accumulate, reportSummary (18→~8)
- TranslateCommand: extract processDomain, processLanguage, loadExisting, findMissingKeys, removeObsoleteKeys, handleUpToDate, mergeAndOrder (36→~10)
- AccountController::index: extract computeFinanceStats with statusMap pattern (19→~12)
Test coverage additions:
- HomeController: expired invitation view, stock not found, stock with billets, search+city with mock results
- AdminController: delete/resend invitation not found (404)
- AccountController: item without billet (codeCoverageIgnore - NOT NULL in DB)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:57:00 +01:00
|
|
|
|
|
|
|
|
$category = new \App\Entity\Category();
|
|
|
|
|
$category->setName('Cat Stock');
|
|
|
|
|
$category->setEvent($event);
|
|
|
|
|
$em->persist($category);
|
|
|
|
|
|
|
|
|
|
$billet = new \App\Entity\Billet();
|
|
|
|
|
$billet->setName('Entree');
|
|
|
|
|
$billet->setCategory($category);
|
|
|
|
|
$billet->setPriceHT(1000);
|
|
|
|
|
$billet->setQuantity(50);
|
|
|
|
|
$em->persist($billet);
|
Add test coverage for remaining controllers, fix label accessibility, refactor duplicated code
New tests (47 added, 622 total):
- MonitorMessengerCommand: no failures, failures with email, null error, multiple (4)
- UnsubscribeController: unsubscribe with invitations refused + admin notified (1)
- AdminController: suspend/reactivate orga, orders page with filters, logs, invite orga submit/empty, delete/resend invitation, export CSV/PDF (13)
- AccountController: export CSV/PDF, getAllowedBilletTypes (free/basic/sur-mesure/null), billet type restriction, finance stats all statuses, soldCounts (9)
- HomeController: city filter, date filter, all filters combined, stock route (4)
- OrderController: event ended, invalid cart JSON, invalid email, stock zero (4)
- MailerService: getAdminEmail, getAdminFrom (2)
- JS: comment node, tabs missing panel/id/parent, cart stock polling edge cases (10)
Accessibility fixes:
- events.html.twig: add for/id on search, city, date labels
- admin/orders.html.twig: add for/id on search, status labels
Code quality:
- cart.js: remove dead ternaire branch (max > 10 always plural)
- tabs.js: use optional chaining for tablist?.setAttribute
- MeilisearchConsistencyCommand: extract diffAndReport() (was duplicated 3x)
- Email templates: extract _order_items_table.html.twig partial
- SonarQube: exclude src/Entity/** from CPD
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:11:07 +01:00
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('GET', '/evenement/'.$event->getId().'/stock');
|
|
|
|
|
self::assertResponseIsSuccessful();
|
Reduce cognitive complexity, improve test coverage, fix SonarQube issues
Cognitive complexity refactors:
- cart.js: extract buildCart, handleCheckout, updateStockLabel, updateItemStock, startStockPolling (21→~8)
- tabs.js: use .at(-1) instead of [length-1]
- MeilisearchConsistencyCommand: extract checkAllIndexes, accumulate, reportSummary (18→~8)
- TranslateCommand: extract processDomain, processLanguage, loadExisting, findMissingKeys, removeObsoleteKeys, handleUpToDate, mergeAndOrder (36→~10)
- AccountController::index: extract computeFinanceStats with statusMap pattern (19→~12)
Test coverage additions:
- HomeController: expired invitation view, stock not found, stock with billets, search+city with mock results
- AdminController: delete/resend invitation not found (404)
- AccountController: item without billet (codeCoverageIgnore - NOT NULL in DB)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:57:00 +01:00
|
|
|
|
|
|
|
|
$data = json_decode($client->getResponse()->getContent(), true);
|
|
|
|
|
self::assertSame(50, $data[$billet->getId()]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventStockNotFound(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/evenement/999999/stock');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
self::assertSame('[]', $client->getResponse()->getContent());
|
Add test coverage for remaining controllers, fix label accessibility, refactor duplicated code
New tests (47 added, 622 total):
- MonitorMessengerCommand: no failures, failures with email, null error, multiple (4)
- UnsubscribeController: unsubscribe with invitations refused + admin notified (1)
- AdminController: suspend/reactivate orga, orders page with filters, logs, invite orga submit/empty, delete/resend invitation, export CSV/PDF (13)
- AccountController: export CSV/PDF, getAllowedBilletTypes (free/basic/sur-mesure/null), billet type restriction, finance stats all statuses, soldCounts (9)
- HomeController: city filter, date filter, all filters combined, stock route (4)
- OrderController: event ended, invalid cart JSON, invalid email, stock zero (4)
- MailerService: getAdminEmail, getAdminFrom (2)
- JS: comment node, tabs missing panel/id/parent, cart stock polling edge cases (10)
Accessibility fixes:
- events.html.twig: add for/id on search, city, date labels
- admin/orders.html.twig: add for/id on search, status labels
Code quality:
- cart.js: remove dead ternaire branch (max > 10 always plural)
- tabs.js: use optional chaining for tablist?.setAttribute
- MeilisearchConsistencyCommand: extract diffAndReport() (was duplicated 3x)
- Email templates: extract _order_items_table.html.twig partial
- SonarQube: exclude src/Entity/** from CPD
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:11:07 +01:00
|
|
|
}
|
|
|
|
|
|
2026-03-20 21:23:21 +01:00
|
|
|
public function testEventDetailNotFoundReturns404(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/evenement/orga/999999-test');
|
|
|
|
|
|
|
|
|
|
self::assertResponseStatusCodeSame(404);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventDetailReturnsSuccess(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-event-orga-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Orga');
|
|
|
|
|
$user->setLastName('Event');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$user->setCompanyName('Asso Event');
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Test Event');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue test');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(true);
|
|
|
|
|
$em->persist($event);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('GET', '/evenement/'.$user->getSlug().'/'.$event->getId().'-'.$event->getSlug());
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-21 18:12:59 +01:00
|
|
|
public function testEventDetailWithCategoriesAndBillets(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-event-billets-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Orga');
|
|
|
|
|
$user->setLastName('Billets');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$user->setCompanyName('Asso Billets');
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Event Billets Test');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue test');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(true);
|
|
|
|
|
$em->persist($event);
|
|
|
|
|
|
|
|
|
|
$category = new \App\Entity\Category();
|
|
|
|
|
$category->setName('Cat Active');
|
|
|
|
|
$category->setEvent($event);
|
|
|
|
|
$category->setStartAt(new \DateTimeImmutable('-1 day'));
|
|
|
|
|
$category->setEndAt(new \DateTimeImmutable('+30 days'));
|
|
|
|
|
$em->persist($category);
|
|
|
|
|
|
|
|
|
|
$billet = new \App\Entity\Billet();
|
|
|
|
|
$billet->setName('Entree');
|
|
|
|
|
$billet->setCategory($category);
|
|
|
|
|
$billet->setPriceHT(1500);
|
|
|
|
|
$em->persist($billet);
|
|
|
|
|
|
|
|
|
|
$billetNotBuyable = new \App\Entity\Billet();
|
|
|
|
|
$billetNotBuyable->setName('Non Achetable');
|
|
|
|
|
$billetNotBuyable->setCategory($category);
|
|
|
|
|
$billetNotBuyable->setPriceHT(0);
|
|
|
|
|
$billetNotBuyable->setNotBuyable(true);
|
|
|
|
|
$em->persist($billetNotBuyable);
|
|
|
|
|
|
|
|
|
|
$categoryHidden = new \App\Entity\Category();
|
|
|
|
|
$categoryHidden->setName('Cat Hidden');
|
|
|
|
|
$categoryHidden->setEvent($event);
|
|
|
|
|
$categoryHidden->setIsHidden(true);
|
|
|
|
|
$em->persist($categoryHidden);
|
|
|
|
|
|
|
|
|
|
$categoryInactive = new \App\Entity\Category();
|
|
|
|
|
$categoryInactive->setName('Cat Inactive');
|
|
|
|
|
$categoryInactive->setEvent($event);
|
|
|
|
|
$categoryInactive->setStartAt(new \DateTimeImmutable('+10 days'));
|
|
|
|
|
$categoryInactive->setEndAt(new \DateTimeImmutable('+20 days'));
|
|
|
|
|
$em->persist($categoryInactive);
|
|
|
|
|
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('GET', '/evenement/'.$user->getSlug().'/'.$event->getId().'-'.$event->getSlug());
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-20 21:23:21 +01:00
|
|
|
public function testEventDetailRedirectsOnWrongSlug(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-event-slug-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Slug');
|
|
|
|
|
$user->setLastName('Test');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$user->setCompanyName('Slug Asso');
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Slug Event');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(true);
|
|
|
|
|
$em->persist($event);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('GET', '/evenement/'.$user->getSlug().'/'.$event->getId().'-mauvais-slug');
|
|
|
|
|
self::assertResponseRedirects();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventDetailOfflineReturns404(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-event-offline-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Offline');
|
|
|
|
|
$user->setLastName('Test');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Offline Event');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(false);
|
|
|
|
|
$em->persist($event);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('GET', '/evenement/'.$user->getSlug().'/'.$event->getId().'-'.$event->getSlug());
|
|
|
|
|
self::assertResponseStatusCodeSame(404);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testOfflinePageReturnsSuccess(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('GET', '/offline');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventContactEmptyFieldsRedirects(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-contact-orga-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Contact');
|
|
|
|
|
$user->setLastName('Orga');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Contact Event');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(true);
|
|
|
|
|
$em->persist($event);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('POST', '/evenement/'.$event->getId().'/contact', [
|
|
|
|
|
'name' => '',
|
|
|
|
|
'firstname' => '',
|
|
|
|
|
'email' => '',
|
|
|
|
|
'message' => '',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
self::assertResponseRedirects();
|
|
|
|
|
}
|
2026-03-20 21:55:07 +01:00
|
|
|
|
|
|
|
|
public function testEventDetailRedirectsOnWrongOrgaSlug(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-orga-slug2-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Wrong');
|
|
|
|
|
$user->setLastName('Orga');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$user->setCompanyName('Real Asso');
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Orga Slug Test');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(true);
|
|
|
|
|
$em->persist($event);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('GET', '/evenement/wrong-slug/'.$event->getId().'-'.$event->getSlug());
|
|
|
|
|
self::assertResponseRedirects();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventContactNotFoundReturns404(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$client->request('POST', '/evenement/999999/contact', [
|
|
|
|
|
'name' => 'Test',
|
|
|
|
|
'firstname' => 'Test',
|
|
|
|
|
'email' => 'test@example.com',
|
|
|
|
|
'message' => 'Hello',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
self::assertResponseStatusCodeSame(404);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testEventContactSuccess(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
|
|
|
|
|
$mailer = $this->createMock(\App\Service\MailerService::class);
|
|
|
|
|
$mailer->expects(self::once())->method('sendEmail');
|
|
|
|
|
static::getContainer()->set(\App\Service\MailerService::class, $mailer);
|
|
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
$user->setEmail('test-contact-success-'.uniqid().'@example.com');
|
|
|
|
|
$user->setFirstName('Contact');
|
|
|
|
|
$user->setLastName('Success');
|
|
|
|
|
$user->setPassword('hashed');
|
|
|
|
|
$user->setRoles(['ROLE_ORGANIZER']);
|
|
|
|
|
$user->setIsApproved(true);
|
|
|
|
|
$user->setIsVerified(true);
|
|
|
|
|
$em->persist($user);
|
|
|
|
|
|
|
|
|
|
$event = new \App\Entity\Event();
|
|
|
|
|
$event->setAccount($user);
|
|
|
|
|
$event->setTitle('Contact Success Event');
|
|
|
|
|
$event->setStartAt(new \DateTimeImmutable('2026-08-01 10:00'));
|
|
|
|
|
$event->setEndAt(new \DateTimeImmutable('2026-08-01 18:00'));
|
|
|
|
|
$event->setAddress('1 rue');
|
|
|
|
|
$event->setZipcode('75001');
|
|
|
|
|
$event->setCity('Paris');
|
|
|
|
|
$event->setIsOnline(true);
|
|
|
|
|
$em->persist($event);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('POST', '/evenement/'.$event->getId().'/contact', [
|
|
|
|
|
'name' => 'Dupont',
|
|
|
|
|
'firstname' => 'Jean',
|
|
|
|
|
'email' => 'jean@example.com',
|
|
|
|
|
'message' => 'Question sur votre evenement',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
self::assertResponseRedirects();
|
|
|
|
|
}
|
2026-03-18 22:50:23 +01:00
|
|
|
}
|