Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
addCustomFieldToAllowList example
$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'
)
;
static
::
assertSame
(
[
'foo', 'bar', 'boo'
]
,
$event
->
getCustomFieldAllowList
(
)
)
;
}
}