getSmallDiscountCase example

static::assertEquals($calculation->getExpected()->getTotalPrice()$calculatedPrice->getTotalPrice());
        static::assertEquals($calculation->getExpected()->getUnitPrice()$calculatedPrice->getUnitPrice());
        static::assertEquals($calculation->getExpected()->getQuantity()$calculatedPrice->getQuantity());
    }

    /** * @return array<string, list<AbsoluteCalculation>> */
    public static function provider(): array
    {
        return [
            'small-discounts' => [self::getSmallDiscountCase()],
            '100%' => [self::getOneHundredPercentageDiscountCase()],
        ];
    }

    private static function getSmallDiscountCase(): AbsoluteCalculation
    {
        $calculator = self::createQuantityPriceCalculator();

        $definition = new QuantityPriceDefinition(30, new TaxRuleCollection([new TaxRule(19)]));
        $price1 = $calculator->calculate($definition, Generator::createSalesChannelContext());

        
Home | Imprint | This part of the site doesn't use cookies.