Add tests for EventIndexService catch blocks when Meilisearch is unavailable
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -108,6 +108,28 @@ class EventIndexServiceTest extends TestCase
|
||||
$this->service->removeEvent($event);
|
||||
}
|
||||
|
||||
public function testIndexEventCatchesException(): void
|
||||
{
|
||||
$event = $this->createEvent();
|
||||
|
||||
$this->meilisearch->method('createIndexIfNotExists')
|
||||
->willThrowException(new \RuntimeException('Meilisearch down'));
|
||||
|
||||
$this->service->indexEvent($event);
|
||||
self::assertTrue(true);
|
||||
}
|
||||
|
||||
public function testRemoveEventCatchesException(): void
|
||||
{
|
||||
$event = $this->createEvent();
|
||||
|
||||
$this->meilisearch->method('deleteDocument')
|
||||
->willThrowException(new \RuntimeException('Meilisearch down'));
|
||||
|
||||
$this->service->removeEvent($event);
|
||||
self::assertTrue(true);
|
||||
}
|
||||
|
||||
public function testRemoveEventGlobalIndexNotExists(): void
|
||||
{
|
||||
$event = $this->createEvent();
|
||||
|
||||
Reference in New Issue
Block a user