// order promotion with two products
$this->
orderWithPromotion($code,
[$productId1,
$productId2],
$context);
$promotion =
$this->promotionRepository
->
search(new Criteria([$promotionId]), Context::
createDefaultContext()) ->
get($promotionId);
static::
assertInstanceOf(PromotionEntity::
class,
$promotion);
// verify that the promotion has an total order count of 1 and the current customer is although tracked
static::
assertEquals(1,
$promotion->
getOrderCount());
static::
assertNotNull($context->
getCustomer());
static::
assertEquals( [$context->
getCustomer()->
getId() => 1
],
$promotion->
getOrdersPerCustomerCount() );
// order promotion with two products
$this->
orderWithPromotion($code,
[$productId1,
$productId2],
$context);
/** @var PromotionEntity $promotion */
$promotion =
$this->promotionRepository