/** * @param OrderInterface $order * * @return OrderInterface */ public function recalculate(OrderInterface $order) { $this->pricesRecalculator->recalculate($order); $this->shippingChargesProcessor->applyShippingCharges($order); $this->promotionProcessor->process($order); $this->taxesApplicator->apply($order); }
/** * @param OrderInterface $order * * @return OrderInterface */ public function recalculate(OrderInterface $order) { $this->adjustmentsRemover->removeFrom($order); $this->pricesRecalculator->recalculate($order); $this->shippingChargesProcessor->applyShippingCharges($order); $this->promotionProcessor->process($order); $this->taxesProcessor->process($order); }
function it_recalculates_order_promotions_taxes_and_shipping_charges(PromotionProcessorInterface $promotionProcessor, PricesRecalculatorInterface $pricesRecalculator, OrderTaxesProcessorInterface $taxesProcessor, ShippingChargesProcessorInterface $shippingChargesProcessor, OrderInterface $order) { $pricesRecalculator->recalculate($order); $promotionProcessor->process($order)->shouldBeCalled(); $taxesProcessor->process($order)->shouldBeCalled(); $shippingChargesProcessor->applyShippingCharges($order)->shouldBeCalled(); $this->recalculate($order); }