createLineItemWithCreatedDate example


    }

    /** * This test verifies that our rule works correctly * with all the different operators and values. * * @dataProvider getMatchValues */
    public function testRuleMatching(bool $expected, string $itemCreated, string $ruleDate, string $operator): void
    {
        $lineItem = $this->createLineItemWithCreatedDate($itemCreated);

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

        $this->rule->assign(['lineItemCreationDate' => $ruleDate, 'operator' => $operator]);

        $isMatching = $this->rule->match($scope);

        static::assertSame($expected$isMatching);
    }
Home | Imprint | This part of the site doesn't use cookies.