class CartHasDeliveryFreeItemRuleTest extends TestCase
{ /**
* @dataProvider inputProvider
*/
public function testMatchInLineItemScope(?bool
$lineItemWithFreeDelivery): void
{ $scope =
new LineItemScope($this->
getLineItem($lineItemWithFreeDelivery),
$this->
createMock(SalesChannelContext::
class));
$rule =
new CartHasDeliveryFreeItemRule(true
);
static::
assertSame($lineItemWithFreeDelivery ?? false,
$rule->
match($scope));
$rule =
new CartHasDeliveryFreeItemRule(false
);
static::
assertSame(!
$lineItemWithFreeDelivery,
$rule->
match($scope));
} /**
* @dataProvider inputProvider
*/
public function testMatchInCartScope(?bool
$lineItemWithFreeDelivery): void
{ $scope =
new CartRuleScope(new Cart(Uuid::
randomHex()),
$this->
createMock(SalesChannelContext::
class));