if ($withRules === true
) { $matchId =
$diffrentId === true ? Uuid::
randomHex() :
$lineItem->
getId();
$ruleCollection->
add($this->
buildRuleEntity( $this->
getProductsRule([$matchId]) ));
} $group =
new LineItemGroupDefinition('test', 'COUNT', 1, 'PRICE_ASC',
$ruleCollection);
static::
assertEquals($expected,
$this->matcher->
isMatching($group,
$lineItem,
$this->context
));
} /**
* @return iterable<string, array<bool>>
*/
public static function lineItemProvider(): iterable
{ yield 'Matching line item not in group with rules' =>
[true, true, false
];
yield 'Matching line item not in group without rules' =>
[false, false, true
];
yield 'Matching line item in group with rules' =>
[true, false, true
];
}