$rule->
setPayload((new LineItemUnitPriceRule())->
assign(['amount' => 10, 'operator' => '='
]));
$ruleCollection =
new RuleCollection([$rule]);
$group =
new PromotionSetGroupEntity();
$group->
setId(Uuid::
randomBytes());
$group->
setPackagerKey('COUNT'
);
$group->
setValue(2
);
$group->
setSorterKey('PRICE_ASC'
);
$group->
setSetGroupRules($ruleCollection);
$this->promotion->
setSetgroups(new PromotionSetGroupCollection([$group]));
$builder =
new PromotionItemBuilder();
$item =
$builder->
buildDiscountLineItem('',
$this->promotion,
$discount, Defaults::CURRENCY,
$currencyFactor);
$expected =
[ 'promotionId' => 'PR-1',
'discountType' => 'percentage',
'value' => '0',
'maxValue' => '',
'discountId' => 'P123',