CodeExplorer CartRuleLoader example
->
method('process'
) ->
with(static::
isInstanceOf(Cart::
class),
$salesChannelContext,
static::
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());
}