FilterSorterPriceAsc example

$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' => [
            new FilterSorterPriceAsc(),
            [
                new LineItemQuantity('a', 1),
                new LineItemQuantity('b', 1),
                new LineItemQuantity('c', 1),
            ],
            [
                self::item('a', 200),
                self::item('b', 100),
                self::item('c', 300),
            ],
            ['b', 'a', 'c'],
        ];
Home | Imprint | This part of the site doesn't use cookies.