Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertInvoicedAmountOnFrontend.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Sales\Test\Page\CustomerOrderView;
11 use Magento\Sales\Test\Page\InvoiceView;
12 use Magento\Sales\Test\Page\OrderHistory;
13 
19 {
30  public function processAssert(
31  OrderHistory $orderHistory,
32  OrderInjectable $order,
33  CustomerOrderView $customerOrderView,
34  InvoiceView $invoiceView,
35  array $ids
36  ) {
37  $this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer());
38  $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId());
39  $customerOrderView->getOrderViewBlock()->openLinkByName('Invoices');
40  foreach ($ids['invoiceIds'] as $key => $invoiceId) {
41  \PHPUnit\Framework\Assert::assertEquals(
42  number_format($order->getPrice()['invoice'][$key]['grand_invoice_total'], 2),
43  $invoiceView->getInvoiceBlock()->getItemBlock($invoiceId)->getGrandTotal()
44  );
45  }
46  }
47 
53  public function toString()
54  {
55  return 'Invoiced Grand Total amount is equal to placed order Grand Total amount on invoice page.';
56  }
57 }
processAssert(OrderHistory $orderHistory, OrderInjectable $order, CustomerOrderView $customerOrderView, InvoiceView $invoiceView, array $ids)
$order
Definition: order.php:55