Add test for Meilisearch organizer sync coverage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -116,6 +116,27 @@ class AdminControllerTest extends WebTestCase
|
||||
self::assertResponseRedirects('/admin');
|
||||
}
|
||||
|
||||
public function testSyncMeilisearchWithOrganizers(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
$em = static::getContainer()->get(EntityManagerInterface::class);
|
||||
$admin = $this->createUser(['ROLE_ROOT']);
|
||||
|
||||
$orga = $this->createOrganizer($em);
|
||||
$orga->setIsApproved(true);
|
||||
$em->flush();
|
||||
|
||||
$meilisearch = $this->createMock(MeilisearchService::class);
|
||||
$meilisearch->expects(self::exactly(2))->method('createIndexIfNotExists');
|
||||
$meilisearch->expects(self::exactly(2))->method('addDocuments');
|
||||
static::getContainer()->set(MeilisearchService::class, $meilisearch);
|
||||
|
||||
$client->loginUser($admin);
|
||||
$client->request('POST', '/admin/sync-meilisearch');
|
||||
|
||||
self::assertResponseRedirects('/admin');
|
||||
}
|
||||
|
||||
public function testBuyersSearchWithMeilisearchError(): void
|
||||
{
|
||||
$client = static::createClient();
|
||||
|
||||
Reference in New Issue
Block a user