Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDeliveryCollection example
static
::
assertIsString
(
$expectedJson
)
;
$actual
= \
json_encode
(
$result
, \JSON_THROW_ON_ERROR
)
;
static
::
assertIsString
(
$actual
)
;
// As json to avoid classes
static
::
assertJsonStringEqualsJsonString
(
$expectedJson
,
$actual
)
;
}
public
function
testConvertToOrderWithDeliveries
(
)
: void
{
$cart
=
$this
->
getCart
(
)
;
$cart
->
setDeliveries
(
$this
->
getDeliveryCollection
(
)
)
;
$result
=
$this
->orderConverter->
convertToOrder
(
$cart
,
$this
->
getSalesChannelContext
(
true
)
,
new
OrderConversionContext
(
)
)
;
// unset uncheckable ids
unset
(
$result
[
'id'
]
)
;
unset
(
$result
[
'billingAddressId'
]
)
;
unset
(
$result
[
'deepLinkCode'
]
)
;
unset
(
$result
[
'orderDateTime'
]
)
;
unset
(
$result
[
'stateId'
]
)
;
unset
(
$result
[
'languageId'
]
)
;
for
(
$i
= 0;
$i
<
(
is_countable
(
$result
[
'lineItems'
]
)
? \
count
(
$result
[
'lineItems'
]
)
: 0
)
; ++
$i
)
{