Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getCustomerCart example
$context
= Context::
createDefaultContext
(
)
;
$salesChannelContext
->
method
(
'getContext'
)
->
willReturn
(
$context
)
;
$event
=
new
BeforeCartMergeEvent
(
$customerCart
,
$guestCart
,
$mergeableLineItems
,
$salesChannelContext
)
;
static
::
assertSame
(
$customerCart
,
$event
->
getCustomerCart
(
)
)
;
static
::
assertSame
(
$guestCart
,
$event
->
getGuestCart
(
)
)
;
static
::
assertSame
(
$mergeableLineItems
,
$event
->
getMergeableLineItems
(
)
)
;
static
::
assertSame
(
$salesChannelContext
,
$event
->
getSalesChannelContext
(
)
)
;
static
::
assertSame
(
$context
,
$event
->
getContext
(
)
)
;
}
}