LanguageSubscriber example

static::assertSame(['sales_channel_language.written' => 'onSalesChannelWritten'], LanguageSubscriber::getSubscribedEvents());
    }

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

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

        $subscriber = new LanguageSubscriber(
            $esHelper,
            $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');

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