regression_next_12270 example

static::assertEquals($expected->getTaxRules()$price->getTaxRules());
        static::assertEquals($expected->getTotalPrice()$price->getTotalPrice());
        static::assertEquals($expected->getUnitPrice()$price->getUnitPrice());
        static::assertEquals($expected->getQuantity()$price->getQuantity());
    }

    public static function grossPriceDataProvider(): \Generator
    {
        yield [self::getDifferentTaxesCalculation()];
        yield [self::getOneHundredPercentageCalculation()];
        yield [self::getFiftyPercentageCalculation()];
        yield [self::regression_next_12270()];
    }

    private static function regression_next_12270(): PercentageCalculation
    {
        $calculator = self::createQuantityPriceCalculator();

        $priceDefinition = new QuantityPriceDefinition(10.40, new TaxRuleCollection([new TaxRule(21, 100)]), 1);
        $price = $calculator->calculate($priceDefinition, Generator::createSalesChannelContext());
        static::assertSame(10.40, $price->getTotalPrice());
        static::assertSame(1.80, $price->getCalculatedTaxes()->getAmount());

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