/**
* @dataProvider sortingProvider
*
* @param array<LineItem> $items
* @param array<LineItemQuantity> $meta
* @param array<string> $expected
*/
public function testSorting(AbstractPriceSorter
$sorter, array
$meta, array
$items, array
$expected): void
{ $package =
new DiscountPackage(new LineItemQuantityCollection($meta));
$package->
setCartItems(new LineItemFlatCollection($items));
$sorter->
sort(new DiscountPackageCollection([$package]));
$ordered =
$package->
getMetaData()->
fmap(fn (LineItemQuantity
$item) =>
$item->
getLineItemId());
static::
assertEquals($expected,
$ordered);
} public static function sortingProvider(): \Generator
{ yield 'Test ascending sorting' =>
[