CodeExplorer createLineItemWithWeight example
string
$operator,
float
$weight,
float
$lineItemWeight,
bool
$expected,
bool
$lineItemWithoutDeliveryInfo = false
): void
{ $this->rule->
assign([ 'amount' =>
$weight,
'operator' =>
$operator,
]);
$lineItem =
$this->
createLineItemWithWeight($lineItemWeight);
if ($lineItemWithoutDeliveryInfo) { $lineItem =
$this->
createLineItem();
} $match =
$this->rule->
match(new LineItemScope( $lineItem,
$this->
createMock(SalesChannelContext::
class) ));
static::
assertSame($expected,
$match);
}