예제 #1
0
 function it_returns_regular_price_of_discount_order_item(OrderItemInterface $orderItem)
 {
     $orderItem->getQuantity()->willReturn(2);
     $orderItem->getUnitPrice()->willReturn(1000);
     $orderItem->getAdjustmentsTotalRecursively(AdjustmentInterface::TAX_ADJUSTMENT)->willReturn(1000);
     $this->getRegularPrice($orderItem)->shouldReturn(3000);
 }
예제 #2
0
 function it_does_not_include_shipping_promotion_adjustment_in_order_promotion_total(AdjustmentInterface $shippingPromotionAdjustment, OrderItemInterface $orderItem1)
 {
     $orderItem1->getTotal()->willReturn(500);
     $orderItem1->getAdjustmentsTotalRecursively(AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT)->willReturn(-400);
     $shippingPromotionAdjustment->getType()->willReturn(AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT);
     $shippingPromotionAdjustment->isNeutral()->willReturn(false);
     $shippingPromotionAdjustment->getAmount()->willReturn(-100);
     $orderItem1->setOrder($this)->shouldBeCalled();
     $this->addItem($orderItem1);
     $shippingPromotionAdjustment->setAdjustable($this)->shouldBeCalled();
     $this->addAdjustment($shippingPromotionAdjustment);
     $this->getOrderPromotionTotal()->shouldReturn(-400);
 }
예제 #3
0
 /**
  * @param OrderItemInterface $orderItem
  *
  * @return int
  */
 public function getRegularPrice(OrderItemInterface $orderItem)
 {
     return $orderItem->getUnitPrice() * $orderItem->getQuantity() + $orderItem->getAdjustmentsTotalRecursively(AdjustmentInterface::TAX_ADJUSTMENT);
 }