->
search($criteria,
$context->
getContext()) ->
get($orderId);
static::
assertNotNull($order);
$cart =
$this->
getContainer()->
get(OrderConverter::
class) ->
convertToCart($order,
$context->
getContext());
$context->
setPermissions([ PromotionProcessor::SKIP_PROMOTION => true,
]);
$cart =
$this->cartService->
recalculate($cart,
$context);
static::
assertCount(2,
$cart->
getLineItems());
$promotion =
$cart->
getLineItems()->
filterType(LineItem::PROMOTION_LINE_ITEM_TYPE
);
static::
assertCount(1,
$promotion, 'Promotion was removed'
);
} /**
* This test verifies that our cart services
* does also correctly remove the matching code
* within our extension, if existing AND a fixed discount has been added that
* is discounting TWO products.
* We add two products and promotion code, then we grab one promotion discount
* line item id and remove it.
* After that we verify that our code array is empty in our extension (both discounts on the
* two products are removed).
*
* @group promotions
*/