function it_removes_adjustments_from_order_recursively(OrderInterface $order) { $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT)->shouldBeCalled(); $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT)->shouldBeCalled(); $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT)->shouldBeCalled(); $order->removeAdjustmentsRecursively(AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT)->shouldBeCalled(); $order->removeAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT)->shouldBeCalled(); $this->removeFrom($order); }
/** * {@inheritdoc} */ public function removeFrom(OrderInterface $order) { $adjustmentsToRemove = [AdjustmentInterface::ORDER_ITEM_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_SHIPPING_PROMOTION_ADJUSTMENT, AdjustmentInterface::ORDER_UNIT_PROMOTION_ADJUSTMENT, AdjustmentInterface::TAX_ADJUSTMENT]; foreach ($adjustmentsToRemove as $type) { $order->removeAdjustmentsRecursively($type); } }
/** * {@inheritdoc} */ public function process(OrderInterface $order) { foreach (self::$adjustmentsToRemove as $type) { $order->removeAdjustmentsRecursively($type); } }