createLineItemWithPurchasePrice example

bool $expected,
        bool $noPrice = false
    ): void {
        $this->rule->assign([
            'isNet' => false,
            'amount' => $amount,
            'operator' => $operator,
        ]);

        $lineItem = $this->createLineItem();
        if ($lineItemPurchasePriceGross !== null && !$noPrice) {
            $lineItem = $this->createLineItemWithPurchasePrice(0, $lineItemPurchasePriceGross);
        }

        $match = $this->rule->match(new LineItemScope(
            $lineItem,
            $this->createMock(SalesChannelContext::class)
        ));

        static::assertSame($expected$match);
    }

    /** * @dataProvider getMatchingRuleTestData */
Home | Imprint | This part of the site doesn't use cookies.