Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
RefreshIndexSubscriber example
public
function
testGetSubscribedEvents
(
)
: void
{
static
::
assertArrayHasKey
(
RefreshIndexEvent::
class
, RefreshIndexSubscriber::
getSubscribedEvents
(
)
)
;
}
public
function
testHandedWithSkipOption
(
)
: void
{
$registry
=
$this
->
createMock
(
AdminSearchRegistry::
class
)
;
$registry
->
expects
(
static
::
once
(
)
)
->
method
(
'iterate'
)
->
with
(
new
AdminIndexingBehavior
(
false,
[
'product'
]
)
)
;
$subscriber
=
new
RefreshIndexSubscriber
(
$registry
)
;
$subscriber
->
handled
(
new
RefreshIndexEvent
(
false,
[
'product'
]
)
)
;
}
public
function
testHandedWithOnlyOption
(
)
: void
{
$registry
=
$this
->
createMock
(
AdminSearchRegistry::
class
)
;
$registry
->
expects
(
static
::
once
(
)
)
->
method
(
'iterate'
)
->
with
(
new
AdminIndexingBehavior
(
false,
[
]
,
[
'product'
]
)
)
;
$subscriber
=
new
RefreshIndexSubscriber
(
$registry
)
;
$subscriber
->
handled
(
new
RefreshIndexEvent
(
false,
[
]
,
[
'product'
]
)
)
;
}
}