Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setTrackingCodes example
public
function
testIfMatches
(
OrderTrackingCodeRule
$rule
,
array
$trackingCodeData
,
bool
$expected
)
: void
{
$orderDeliveryCollection
=
new
OrderDeliveryCollection
(
)
;
$orderDelivery
=
new
OrderDeliveryEntity
(
)
;
$orderDelivery
->
setId
(
Uuid::
randomHex
(
)
)
;
$orderDelivery
->
setTrackingCodes
(
$trackingCodeData
)
;
$orderDeliveryCollection
->
add
(
$orderDelivery
)
;
$order
=
new
OrderEntity
(
)
;
$order
->
setDeliveries
(
$orderDeliveryCollection
)
;
$cart
=
$this
->
createMock
(
Cart::
class
)
;
$context
=
$this
->
createMock
(
SalesChannelContext::
class
)
;
$match
=
$rule
->
match
(
new
FlowRuleScope
(
$order
,
$cart
,