Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setCustomFieldAllowList example
$event
=
new
CartBeforeSerializationEvent
(
$cart
,
$customFieldAllowList
)
;
static
::
assertSame
(
$cart
,
$event
->
getCart
(
)
)
;
static
::
assertSame
(
$customFieldAllowList
,
$event
->
getCustomFieldAllowList
(
)
)
;
}
public
function
testSetCustomFieldAllowList
(
)
: void
{
$customFieldAllowList
=
[
'foo', 'bar'
]
;
$event
=
new
CartBeforeSerializationEvent
(
new
Cart
(
'cart'
)
,
$customFieldAllowList
)
;
$event
->
setCustomFieldAllowList
(
[
'boo'
]
)
;
static
::
assertSame
(
[
'boo'
]
,
$event
->
getCustomFieldAllowList
(
)
)
;
}
public
function
testAddCustomFieldAllowList
(
)
: void
{
$customFieldAllowList
=
[
'foo', 'bar'
]
;
$event
=
new
CartBeforeSerializationEvent
(
new
Cart
(
'cart'
)
,
$customFieldAllowList
)
;
$event
->
addCustomFieldToAllowList
(
'boo'
)
;