Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
ProductUpdater example
public
function
testUpdate
(
)
: void
{
$indexer
=
$this
->
createMock
(
ElasticsearchIndexer::
class
)
;
$definition
=
$this
->
createMock
(
EntityDefinition::
class
)
;
$indexer
->
expects
(
static
::
once
(
)
)
->
method
(
'updateIds'
)
->
with
(
$definition
,
[
'id1', 'id2'
]
)
;
$event
=
new
ProductIndexerEvent
(
[
'id1', 'id2'
]
, Context::
createDefaultContext
(
)
)
;
$updater
=
new
ProductUpdater
(
$indexer
,
$definition
)
;
$updater
->
update
(
$event
)
;
}
}