$promotionId = Uuid::
randomHex();
$code = 'BF' . Random::
getAlphanumericString(5
);
// add 4 test products
$this->
createTestFixtureProduct($set1ProductId1, 10, 10,
$this->
getContainer(),
$this->context
);
$this->
createTestFixtureProduct($set1ProductId2, 20, 10,
$this->
getContainer(),
$this->context
);
$this->
createTestFixtureProduct($set2ProductId1, 30, 10,
$this->
getContainer(),
$this->context
);
$this->
createTestFixtureProduct($set2ProductId2, 40, 10,
$this->
getContainer(),
$this->context
);
// add 2 test rules
$ruleId1 =
$this->
createRule('Group1Rule',
[$set1ProductId1,
$set1ProductId2],
$this->
getContainer());
$ruleId2 =
$this->
createRule('Group2Rule',
[$set2ProductId1,
$set2ProductId2],
$this->
getContainer());
$groupId1 = 'c5dd14614714432cb145a2642d80fd23';
$groupId2 = 'c1fb8da6d041481c962a1a9f62639c87';
// add a new promotion and two setGroup discounts
$this->
createTestFixtureSetGroupPromotion($promotionId,
$code,
$this->
getContainer());
$this->
createSetGroupWithRuleFixture($groupId1, 'COUNT', 4, 'PRICE_ASC',
$promotionId,
$ruleId1,
$this->
getContainer());
$this->
createSetGroupWithRuleFixture($groupId2, 'COUNT', 4, 'PRICE_ASC',
$promotionId,
$ruleId2,
$this->
getContainer());
$discountId1 =
$this->
createSetGroupDiscount($promotionId, 1,
$this->
getContainer(), 100, null
);
$discountId2 =
$this->
createSetGroupDiscount($promotionId, 2,
$this->
getContainer(), 100, null
);