Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setUpdatedStates example
public
function
testProductStatesBeforeChangeEvent
(
)
: void
{
$updatedStates
=
[
new
UpdatedStates
(
'foobar',
[
'foo'
]
,
[
'bar'
]
)
]
;
$context
= Context::
createDefaultContext
(
)
;
$event
=
new
ProductStatesBeforeChangeEvent
(
$updatedStates
,
$context
)
;
static
::
assertEquals
(
$updatedStates
,
$event
->
getUpdatedStates
(
)
)
;
static
::
assertEquals
(
$context
,
$event
->
getContext
(
)
)
;
$updatedStates
=
[
new
UpdatedStates
(
'foobar',
[
'foo'
]
,
[
'baz'
]
)
]
;
$event
->
setUpdatedStates
(
$updatedStates
)
;
static
::
assertEquals
(
$updatedStates
,
$event
->
getUpdatedStates
(
)
)
;
}
}