onLanguageWritten example

$this->createMock(ElasticsearchRegistry::class),
            $this->createMock(Client::class),
            $this->createMock(ProductDefinition::class),
            $this->createMock(MessageBusInterface::class)
        );

        $event = $this->createMock(EntityWrittenEvent::class);
        $event
            ->expects(static::never())
            ->method('getWriteResults');

        $subscriber->onLanguageWritten($event);
    }

    public function testOnLanguageWrittenWithoutEsDefinition(): void
    {
        Feature::skipTestIfInActive('ES_MULTILINGUAL_INDEX', $this);

        $esHelper = $this->createMock(ElasticsearchHelper::class);
        $esHelper->expects(static::once())->method('allowIndexing')->willReturn(true);

        $writeResult = new EntityWriteResult(Uuid::randomHex()[], OrderDefinition::ENTITY_NAME, EntityWriteResult::OPERATION_UPDATE);

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