createLineItemWithReleaseDate example

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

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

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

    public function testItemWithoutReleaseDateIsFalse(): void
    {
        $scope = new LineItemScope(
            $this->createLineItem(),
            $this->createMock(SalesChannelContext::class)
        );
Home | Imprint | This part of the site doesn't use cookies.