Add coverage for stats tab: empty, with paid orders, with search query
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1145,6 +1145,69 @@ class AccountControllerTest extends WebTestCase
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testEditEventStatsTab(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$em = static::getContainer()->get(EntityManagerInterface::class);
|
||||
$user = $this->createUser(['ROLE_ORGANIZER'], true);
|
||||
|
||||
$event = $this->createEvent($em, $user);
|
||||
|
||||
$client->loginUser($user);
|
||||
$client->request('GET', '/mon-compte/evenement/'.$event->getId().'/modifier?tab=stats');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testEditEventStatsTabWithOrders(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$em = static::getContainer()->get(EntityManagerInterface::class);
|
||||
$user = $this->createUser(['ROLE_ORGANIZER'], true);
|
||||
|
||||
$event = $this->createEvent($em, $user);
|
||||
$category = $this->createCategory($em, $event);
|
||||
$billet = $this->createBillet($em, $category);
|
||||
|
||||
$order = new \App\Entity\BilletBuyer();
|
||||
$order->setEvent($event);
|
||||
$order->setFirstName('Jean');
|
||||
$order->setLastName('Dupont');
|
||||
$order->setEmail('jean@test.fr');
|
||||
$order->setOrderNumber('2026-03-21-'.uniqid());
|
||||
$order->setTotalHT(1500);
|
||||
$order->setStatus(\App\Entity\BilletBuyer::STATUS_PAID);
|
||||
$order->setPaidAt(new \DateTimeImmutable());
|
||||
|
||||
$item = new \App\Entity\BilletBuyerItem();
|
||||
$item->setBillet($billet);
|
||||
$item->setBilletName('Test');
|
||||
$item->setQuantity(2);
|
||||
$item->setUnitPriceHT(750);
|
||||
$order->addItem($item);
|
||||
$em->persist($order);
|
||||
$em->flush();
|
||||
|
||||
$client->loginUser($user);
|
||||
$client->request('GET', '/mon-compte/evenement/'.$event->getId().'/modifier?tab=stats');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testEditEventStatsTabWithSearch(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$em = static::getContainer()->get(EntityManagerInterface::class);
|
||||
$user = $this->createUser(['ROLE_ORGANIZER'], true);
|
||||
|
||||
$event = $this->createEvent($em, $user);
|
||||
|
||||
$client->loginUser($user);
|
||||
$client->request('GET', '/mon-compte/evenement/'.$event->getId().'/modifier?tab=stats&q=dupont');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testAddBilletPage(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
|
||||
Reference in New Issue
Block a user