2026-03-18 22:50:23 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Tests\Controller;
|
|
|
|
|
|
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 App\Entity\EmailTracking;
|
|
|
|
|
use Doctrine\ORM\EntityManagerInterface;
|
2026-03-18 22:50:23 +01:00
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
|
|
|
|
|
|
|
|
class EmailTrackingControllerTest extends WebTestCase
|
|
|
|
|
{
|
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
|
|
|
private function ensureLogoExists(): void
|
2026-03-18 22:50:23 +01:00
|
|
|
{
|
2026-03-18 23:04:31 +01:00
|
|
|
$projectDir = static::getContainer()->getParameter('kernel.project_dir');
|
|
|
|
|
$logoPath = $projectDir.'/public/logo.jpg';
|
|
|
|
|
|
|
|
|
|
if (!file_exists($logoPath)) {
|
|
|
|
|
file_put_contents($logoPath, 'fake-image');
|
|
|
|
|
}
|
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 testTrackReturnsImageResponse(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$this->ensureLogoExists();
|
2026-03-18 23:04:31 +01:00
|
|
|
|
2026-03-18 22:50:23 +01:00
|
|
|
$client->request('GET', '/track/nonexistent-id/logo.jpg');
|
|
|
|
|
|
|
|
|
|
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 testTrackMarksAsOpened(): void
|
|
|
|
|
{
|
|
|
|
|
$client = static::createClient();
|
|
|
|
|
$this->ensureLogoExists();
|
|
|
|
|
|
|
|
|
|
$em = static::getContainer()->get(EntityManagerInterface::class);
|
|
|
|
|
$tracking = new EmailTracking('test-track-'.uniqid(), 'user@example.com', 'Test Subject');
|
|
|
|
|
$em->persist($tracking);
|
|
|
|
|
$em->flush();
|
|
|
|
|
|
|
|
|
|
$client->request('GET', '/track/'.$tracking->getMessageId().'/logo.jpg');
|
|
|
|
|
|
|
|
|
|
self::assertResponseIsSuccessful();
|
2026-03-18 23:04:31 +01:00
|
|
|
|
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
|
|
|
$em->refresh($tracking);
|
|
|
|
|
self::assertSame('opened', $tracking->getState());
|
|
|
|
|
self::assertNotNull($tracking->getOpenedAt());
|
2026-03-18 22:50:23 +01:00
|
|
|
}
|
|
|
|
|
}
|