createCartDummy example

string $operator,
        float $weight,
        float $lineItemWeight1,
        float $lineItemWeight2,
        bool $expected,
        bool $lineItem1WithoutDeliveryInfo = false,
        bool $lineItem2WithoutDeliveryInfo = false
    ): void {
        $this->rule->assign(['weight' => $weight, 'operator' => $operator]);

        $match = $this->rule->match(new CartRuleScope(
            $this->createCartDummy($lineItemWeight1$lineItemWeight2$lineItem1WithoutDeliveryInfo$lineItem2WithoutDeliveryInfo),
            $this->createMock(SalesChannelContext::class)
        ));

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

    /** * @dataProvider getMatchingRuleTestData */
    public function testIfMatchesCorrectOnEqualWeightNested(
        string $operator,
        
/** * @dataProvider getMatchingRuleTestData */
    public function testIfMatchesCorrect(
        string $operator,
        float $volume,
        bool $expected
    ): void {
        $this->rule->assign(['volume' => $volume, 'operator' => $operator]);

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

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

    /** * @dataProvider getMatchingRuleTestData */
    public function testIfMatchesCorrectOnNested(
        string $operator,
        
Home | Imprint | This part of the site doesn't use cookies.