Add admin events page with Meilisearch search, KnpPaginator, and navigation link
- Add Evenements link in admin navigation bar - Create /admin/evenements page with event table (title, organizer, date, city, status, secret) - Search via Meilisearch event_admin index with fallback to database - KnpPaginator (10 per page) - Add 3 tests (success, search, access denied) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -595,6 +595,39 @@ class AdminControllerTest extends WebTestCase
|
||||
return $user;
|
||||
}
|
||||
|
||||
public function testEventsPageReturnsSuccess(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$admin = $this->createUser(['ROLE_ROOT']);
|
||||
|
||||
$client->loginUser($admin);
|
||||
$client->request('GET', '/admin/evenements');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testEventsPageWithSearch(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$admin = $this->createUser(['ROLE_ROOT']);
|
||||
|
||||
$client->loginUser($admin);
|
||||
$client->request('GET', '/admin/evenements?q=brocante');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testEventsPageDeniedForNonRoot(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$user = $this->createUser();
|
||||
|
||||
$client->loginUser($user);
|
||||
$client->request('GET', '/admin/evenements');
|
||||
|
||||
self::assertResponseStatusCodeSame(403);
|
||||
}
|
||||
|
||||
private function createOrganizer(EntityManagerInterface $em): User
|
||||
{
|
||||
$orga = new User();
|
||||
|
||||
Reference in New Issue
Block a user