PromotionAdminSearchIndexer example

private Client $client;

    protected function setUp(): void
    {
        $this->clearElasticsearch();

        $this->connection = $this->getContainer()->get(Connection::class);

        $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),
            

class PromotionAdminSearchIndexerTest extends TestCase
{
    private PromotionAdminSearchIndexer $searchIndexer;

    protected function setUp(): void
    {
        $this->searchIndexer = new PromotionAdminSearchIndexer(
            $this->createMock(Connection::class),
            $this->createMock(IteratorFactory::class),
            $this->createMock(EntityRepository::class),
            100
        );
    }

    public function testGetEntity(): void
    {
        static::assertSame(PromotionDefinition::ENTITY_NAME, $this->searchIndexer->getEntity());
    }

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