createCartDummyWithShippingCosts example

$this->rule = new CartShippingCostRule();
    }

    /** * @dataProvider getRuleTestData */
    public function testIfMatchesCorrectWithShippingCosts(
        CartShippingCostRule $rule,
        CalculatedPrice $calculatedPrice,
        bool $expected
    ): void {
        $cart = $this->createCartDummyWithShippingCosts($calculatedPrice);
        $childLineItemCollection = $cart->getLineItems();

        $containerLineItem = $this->createContainerLineItem($childLineItemCollection);

        $cart->setLineItems(new LineItemCollection([$containerLineItem]));

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

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