$context =
$this->
createMock(SalesChannelContext::
class);
$discount =
new DiscountLineItem('test',
new QuantityPriceDefinition(10,
new TaxRuleCollection([]), 1
),
[ 'discountScope' => 'scope',
'discountType' => 'type',
'filter' =>
[],
], null
);
$packages =
$packager->
getMatchingItems($discount,
$cart,
$context);
$ids =
$packages->
first()?->
getMetaData()->
map(fn (LineItemQuantity
$item) =>
$item->
getLineItemId());
static::
assertEquals($expected,
$ids);
} public static function buildPackagesProvider(): \Generator
{ $stackable =
new LineItem('stackable', LineItem::PRODUCT_LINE_ITEM_TYPE, null, 1
);
$stackable->
setPrice(new CalculatedPrice(100, 100,
new CalculatedTaxCollection(),
new TaxRuleCollection()));
$stackable->
setStackable(true
);
$other =
new LineItem('other', LineItem::PRODUCT_LINE_ITEM_TYPE, null, 2
);