Extract searchEvents() to EventIndexService, reduce duplication across controllers
- Add searchEvents() method: Meilisearch search with DB fallback - Use in HomeController, AdminController, AccountController (removes ~45 duplicated lines) - Add assets/vendor/ to ESLint ignores - Update EventIndexServiceTest for new constructor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Entity\Event;
|
||||
use App\Entity\User;
|
||||
use App\Service\EventIndexService;
|
||||
use App\Service\MeilisearchService;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class EventIndexServiceTest extends TestCase
|
||||
@@ -16,7 +17,8 @@ class EventIndexServiceTest extends TestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->meilisearch = $this->createMock(MeilisearchService::class);
|
||||
$this->service = new EventIndexService($this->meilisearch);
|
||||
$em = $this->createMock(EntityManagerInterface::class);
|
||||
$this->service = new EventIndexService($this->meilisearch, $em);
|
||||
}
|
||||
|
||||
private function createEvent(bool $online = true, bool $secret = false): Event
|
||||
|
||||
Reference in New Issue
Block a user