Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertRefundedGrandTotalOnFrontend.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Sales\Test\Page\CreditMemoView;
11 use Magento\Sales\Test\Page\OrderHistory;
12 use Magento\Sales\Test\Page\CustomerOrderView;
13 
18 {
29  public function processAssert(
30  OrderHistory $orderHistory,
31  OrderInjectable $order,
32  CustomerOrderView $customerOrderView,
33  CreditMemoView $creditMemoView,
34  array $ids
35  ) {
36  $this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer());
37  $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId());
38  $customerOrderView->getOrderViewBlock()->openLinkByName('Refunds');
39  foreach ($ids['creditMemoIds'] as $key => $creditMemoId) {
40  \PHPUnit\Framework\Assert::assertEquals(
41  number_format($order->getPrice()['refund'][$key]['grand_creditmemo_total'], 2),
42  $creditMemoView->getCreditMemoBlock()->getItemBlock($creditMemoId)->getGrandTotal()
43  );
44  }
45  }
46 
52  public function toString()
53  {
54  return 'Credit memo Grand Total amount is equal to placed order Grand Total amount on credit memo page.';
55  }
56 }
$order
Definition: order.php:55
processAssert(OrderHistory $orderHistory, OrderInjectable $order, CustomerOrderView $customerOrderView, CreditMemoView $creditMemoView, array $ids)