Example #1
0
 /**
  * @param int $idSalesOrderItem
  *
  * @return void
  */
 public function refundItem($idSalesOrderItem)
 {
     $i = $this;
     $i->setItemState($idSalesOrderItem, SalesDetailPage::STATE_RETURNED);
     $i->reloadPage();
     $i->click(SalesDetailPage::BUTTON_REFUND);
     $currentStateSelector = SalesDetailPage::getCurrentStateSelector($idSalesOrderItem);
     $i->assertSame(SalesDetailPage::STATE_REFUNDED, $i->grabTextFrom($currentStateSelector));
 }
Example #2
0
 /**
  * @param \Acceptance\Refund\Sales\Zed\Tester\RefundTester $i
  *
  * @return void
  */
 public function testWhenRefundAllItemsOfOrderRefundedAmountShouldBeSameAsGrandTotal(RefundTester $i)
 {
     $idSalesOrder = $i->createOrder();
     $idSalesOrderItemA = $i->createSalesOrderItemForOrder($idSalesOrder, ['process' => 'DummyPayment01']);
     $idSalesOrderItemB = $i->createSalesOrderItemForOrder($idSalesOrder, ['process' => 'DummyPayment01']);
     $i->triggerEventForNewOrderItems([$idSalesOrderItemA, $idSalesOrderItemB]);
     $salesDetailPageUrl = SalesDetailPage::getOrderDetailsPageUrl($idSalesOrder);
     $i->amOnPage($salesDetailPageUrl);
     $i->refundItem($idSalesOrderItemA);
     $i->refundItem($idSalesOrderItemB);
     $i->seeNumberOfRefunds(2);
     $grandTotal = (int) $i->grabAttributeFrom(SalesDetailPage::SELECTOR_GRAND_TOTAL, SalesDetailPage::ATTRIBUTE_GRAND_TOTAL_RAW);
     $i->assertSame($grandTotal, $i->grabTotalRefundedAmount());
 }