$discount->
setScope(PromotionDiscountEntity::SCOPE_DELIVERY
);
$item =
$builder->
buildDiscountLineItem('',
$this->promotion,
$discount, Defaults::CURRENCY,
$currencyFactor);
static::
assertTrue($item->
hasPayloadValue('promotionId'
), 'We are expecting the promotionId as payload value'
);
static::
assertTrue($item->
hasPayloadValue('discountId'
), 'We are expecting the discountId as payload value'
);
static::
assertTrue($item->
hasPayloadValue('discountType'
), 'We are expecting the discountType as payload value'
);
static::
assertTrue($item->
hasPayloadValue('discountScope'
), 'We are expecting the discount scope as payload value'
);
static::
assertEquals($this->promotion->
getId(),
$item->
getPayloadValue('promotionId'
), 'Wrong value in payload key promotionId'
);
static::
assertEquals($discount->
getId(),
$item->
getPayloadValue('discountId'
), 'Wrong value in payload key discountId'
);
static::
assertEquals($discount->
getType(),
$item->
getPayloadValue('discountType'
), 'Wrong value in payload key discountType'
);
static::
assertEquals($discount->
getScope(),
$item->
getPayloadValue('discountScope'
), 'Wrong value in payload key scope'
);
} /**
* This test verifies that the correct filter
* values are being added to the payload if set
*
* @group promotions
*/
public function testPayloadAdvancedFilterValues(): void
{ $builder =
new PromotionItemBuilder();