static::
assertInstanceOf(PromotionDiscountCollection::
class,
$discounts =
$promotion->
getDiscounts());
static::
assertCount(2,
$discounts);
$firstDiscount =
$discounts->
first();
static::
assertInstanceOf(PromotionDiscountEntity::
class,
$firstDiscount);
static::
assertEquals('cart',
$firstDiscount->
getScope());
static::
assertEquals('absolute',
$firstDiscount->
getType());
static::
assertEquals(5,
$firstDiscount->
getValue());
static::
assertFalse($firstDiscount->
isConsiderAdvancedRules());
static::
assertNull($firstDiscount->
getMaxValue());
static::
assertEquals('PRICE_ASC',
$firstDiscount->
getSorterKey());
static::
assertEquals('ALL',
$firstDiscount->
getApplierKey());
static::
assertEquals('ALL',
$firstDiscount->
getUsageKey());
static::
assertEmpty($firstDiscount->
getPickerKey());
static::
assertInstanceOf(RuleCollection::
class,
$firstDiscountRules =
$firstDiscount->
getDiscountRules());
static::
assertEmpty($firstDiscountRules->
getIds());
$lastDiscount =
$discounts->
last();
static::
assertInstanceOf(PromotionDiscountEntity::
class,
$lastDiscount);
static::
assertEquals('set',
$lastDiscount->
getScope());
static::
assertEquals('percentage',
$lastDiscount->
getType());
static::
assertEquals(2.5,
$lastDiscount->
getValue());
static::
assertTrue($lastDiscount->
isConsiderAdvancedRules());