AdminSearchRegistry example

public function testGetSubscribedEvents(): void
    {
        $events = AdminSearchRegistry::getSubscribedEvents();

        static::assertArrayHasKey(EntityWrittenContainerEvent::class$events);
    }

    public function testGetIndexers(): void
    {
        $searchHelper = new AdminElasticsearchHelper(true, false, 'sw-admin');
        $registry = new AdminSearchRegistry(
            ['promotion' => $this->indexer],
            $this->createMock(Connection::class),
            $this->createMock(MessageBusInterface::class),
            $this->createMock(EventDispatcherInterface::class),
            $this->createMock(Client::class),
            $searchHelper,
            [],
            []
        );
        $indexers = $registry->getIndexers();

        
$this->client = $this->getContainer()->get(Client::class);

        $indexer = new PromotionAdminSearchIndexer(
            $this->connection,
            $this->getContainer()->get(IteratorFactory::class),
            $this->getContainer()->get('promotion.repository'),
            100
        );

        $searchHelper = new AdminElasticsearchHelper(true, true, 'sw-admin');
        $this->registry = new AdminSearchRegistry(
            ['promotion' => $indexer],
            $this->connection,
            $this->createMock(MessageBusInterface::class),
            $this->createMock(EventDispatcherInterface::class),
            $this->client,
            $searchHelper,
            [],
            []
        );
    }

    
Home | Imprint | This part of the site doesn't use cookies.