CartRuleLoader example

->method('process')
            ->with(static::isInstanceOf(Cart::class)$salesChannelContextstatic::isInstanceOf(CartBehavior::class))
            ->willReturn($calculatedCart);

        $ruleLoader = $this->createMock(RuleLoader::class);
        $ruleLoader
            ->expects(static::once())
            ->method('load')
            ->with($salesChannelContext->getContext())
            ->willReturn(new RuleCollection());

        $cartRuleLoader = new CartRuleLoader(
            $persister,
            $processor,
            new NullLogger(),
            $this->createMock(CacheInterface::class),
            $ruleLoader,
            $this->createMock(TaxDetector::class),
            $this->createMock(Connection::class),
            $factory,
        );

        static::assertSame($calculatedCart$cartRuleLoader->loadByToken($salesChannelContext$salesChannelContext->getToken())->getCart());
    }
Home | Imprint | This part of the site doesn't use cookies.