use IntegrationTestBehaviour;
final public const DISCOUNT_ID = 'discount-id';
/**
* @param array<LineItem> $items
*
* @dataProvider processorProvider
*/
public function testProcessor(array
$items, ?CalculatedPrice
$expected): void
{ $processor =
$this->
getContainer()->
get(DiscountCartProcessor::
class);
$context =
$this->
getContainer()->
get(SalesChannelContextFactory::
class) ->
create(Uuid::
randomHex(), TestDefaults::SALES_CHANNEL
);
$cart =
new Cart('test'
);
$cart->
setLineItems(new LineItemCollection($items));
$new =
new Cart('after'
);
$new->
setLineItems( (new LineItemCollection($items))->
filter(fn (LineItem
$item) =>
$item->
getType() !== LineItem::DISCOUNT_LINE_ITEM
) );