EsProductDefinition example

$this->ids = new IdsCollection();
    }

    public function testMapping(): void
    {
        $connection = $this->createMock(Connection::class);
        $connection->expects(static::exactly(2))->method('fetchAllKeyValue')->willReturn([
            'lang_en' => 'en-GB',
            'lang_de' => 'de-DE',
        ]);

        $definition = new EsProductDefinition(
            $this->createMock(ProductDefinition::class),
            $connection,
            [],
            new EventDispatcher(),
            $this->createMock(AbstractProductSearchQueryBuilder::class),
            [
                'en' => 'sw_english_analyzer',
                'de' => 'sw_german_analyzer',
            ]
        );

        

        Feature::skipTestIfActive('ES_MULTILINGUAL_INDEX', $this);
    }

    public function testMapping(): void
    {
        $connection = $this->createMock(Connection::class);
        $connection->expects(static::once())
            ->method('fetchAllKeyValue')
            ->willReturn(['test' => CustomFieldTypes::INT]);

        $newImplementation = new EsProductDefinition(
            $this->createMock(ProductDefinition::class),
            $connection,
            [],
            new EventDispatcher(),
            $this->createMock(AbstractProductSearchQueryBuilder::class),
            [
                'en' => 'english',
                'de' => 'german',
            ]
        );

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