CodeExplorercreateLineItemWithListPrice example
float
$percentage,
float
$price,
?float
$listPrice,
bool
$expected,
bool
$lineItemWithoutPrice = false
): void
{ $this->rule->
assign([ 'amount' =>
$percentage,
'operator' =>
$operator,
]);
$lineItem =
$this->
createLineItemWithListPrice($price,
$listPrice);
if ($lineItemWithoutPrice) { $lineItem =
$this->
createLineItem();
} $match =
$this->rule->
match(new LineItemScope( $lineItem,
$this->
createMock(SalesChannelContext::
class) ));
static::
assertSame($expected,
$match);
} string
$operator,
?float
$amount,
?float
$lineItemAmount,
bool
$expected,
bool
$lineItemWithoutPrice = false
): void
{ $this->rule->
assign([ 'amount' =>
$amount,
'operator' =>
$operator,
]);
$lineItem =
$this->
createLineItemWithListPrice($lineItemAmount);
if ($lineItemWithoutPrice) { $lineItem =
$this->
createLineItem();
} $match =
$this->rule->
match(new LineItemScope( $lineItem,
$this->
createMock(SalesChannelContext::
class) ));
static::
assertSame($expected,
$match);
}