$orderConverter->
convertToOrder($this->
getCart(),
$this->
getSalesChannelContext(true
),
new OrderConversionContext());
} public function testConvertionWithDownloads(): void
{ $cart =
$this->orderConverter->
convertToCart($this->
getOrder('order-add-line-item-download'
), Context::
createDefaultContext());
$lineItem =
$cart->
getLineItems()->
first();
static::
assertNotNull($lineItem);
static::
assertInstanceOf(LineItem::
class,
$lineItem);
$collection =
$lineItem->
getExtensionOfType(OrderConverter::ORIGINAL_DOWNLOADS, OrderLineItemDownloadCollection::
class);
static::
assertInstanceOf(OrderLineItemDownloadCollection::
class,
$collection);
static::
assertEquals(1,
$collection->
count());
$cart =
$this->
getCart();
$cart->
getLineItems()->
clear();
$lineItemA =
(new LineItem('line-item-label-1', 'line-item-label-1', Uuid::
randomHex())) ->
setPrice(new CalculatedPrice(1, 1,
new CalculatedTaxCollection(),
new TaxRuleCollection())) ->
setLabel('line-item-label-1'
) ->
setStates([State::IS_DOWNLOAD
]);
$lineItemA->
addExtension(OrderConverter::ORIGINAL_DOWNLOADS,
$collection);
$lineItemB =
(new LineItem('line-item-label-2', 'line-item-label-2', Uuid::
randomHex()))