Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
OrderPersister example
$repository
->
method
(
'search'
)
->
willReturn
(
new
EntitySearchResult
(
'order',
1,
new
EntityCollection
(
[
$order
]
)
,
null,
new
Criteria
(
)
,
Context::
createDefaultContext
(
)
)
)
;
$persister
=
new
OrderPersister
(
$repository
,
$this
->orderConverter
)
;
$persister
->
persist
(
$cart
,
$this
->
getSalesChannelContext
(
)
)
;
}
public
function
testSaveWithMissingLabel
(
)
: void
{
$cart
=
new
Cart
(
'a-b-c'
)
;
$cart
->
add
(
(
new
LineItem
(
'test', LineItem::CREDIT_LINE_ITEM_TYPE
)
)
->
setPriceDefinition
(
new
AbsolutePriceDefinition
(
1
)
)
)
;