getFilterUsageKey example

static::assertEquals('ALL', $this->discount->getFilterApplierKey());
    }

    /** * This test verifies that the property is correctly * assigned as well as returned in the getter function. * * @group promotions */
    public function testUsageApplierKey(): void
    {
        static::assertEquals('UNLIMITED', $this->discount->getFilterUsageKey());
    }

    /** * This test verifies that the property is correctly * assigned as well as returned in the getter function. * * @group promotions */
    public function testPayloads(): void
    {
        $expected = [
            


    public function getDecorated(): PackageFilter
    {
        throw new DecorationPatternException(self::class);
    }

    public function filterPackages(DiscountLineItem $discount, DiscountPackageCollection $packages, int $originalPackageCount): DiscountPackageCollection
    {
        $sorterKey = $discount->getFilterSorterKey();
        $applierKey = $discount->getFilterApplierKey();
        $countKey = $discount->getFilterUsageKey();

        $filteredPackages = [];

        if (!$this->hasFilterSettings($sorterKey$applierKey$countKey)) {
            return new DiscountPackageCollection($packages);
        }

        // now sort each found package depending on our configured sorter         $sortedPackages = $this->registry->getSorter($sorterKey)->sort($packages);

        // calculate an additional maximal count
Home | Imprint | This part of the site doesn't use cookies.