Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
onSalesChannelWritten 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
->
onSalesChannelWritten
(
$event
)
;
}
public
function
testOnNewLanguageIndexGetsCreated
(
)
: void
{
Feature::
skipTestIfActive
(
'ES_MULTILINGUAL_INDEX',
$this
)
;
$bus
=
new
CollectingMessageBus
(
)
;
$elasticsearchHelper
=
$this
->
createMock
(
ElasticsearchHelper::
class
)
;
$elasticsearchHelper
->
expects
(
static
::
once
(
)
)
->
method
(
'allowIndexing'
)
->
willReturn
(
true
)
;