Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractAssertInvoiceReportResult.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
10 use Magento\Mtf\ObjectManager;
11 use Magento\Mtf\System\Event\EventManagerInterface;
12 use Magento\Reports\Test\Page\Adminhtml\SalesInvoiceReport;
14 
18 abstract class AbstractAssertInvoiceReportResult extends AbstractConstraint
19 {
26 
32  protected $order;
33 
40  public function __construct(
41  ObjectManager $objectManager,
42  EventManagerInterface $eventManager,
43  SalesInvoiceReport $salesInvoiceReport
44  ) {
45  parent::__construct($objectManager, $eventManager);
46  $this->salesInvoiceReport = $salesInvoiceReport;
47  }
48 
55  protected function searchInInvoiceReportGrid(array $invoiceReport)
56  {
57  $this->salesInvoiceReport->open();
58  $this->salesInvoiceReport->getMessagesBlock()->clickLinkInMessage('notice', 'here');
59  $this->salesInvoiceReport->getFilterForm()->viewsReport($invoiceReport);
60  $this->salesInvoiceReport->getActionBlock()->showReport();
61  }
62 
69  protected function prepareExpectedResult(array $expectedInvoiceData)
70  {
71  $totalInvoice = $this->order->getPrice()['invoice'][0]['grand_invoice_total'];
72  $expectedInvoiceData['invoiced'] += 1;
73  $expectedInvoiceData['qty'] += 1;
74  $expectedInvoiceData['total-invoiced'] += $totalInvoice;
75 
76  return $expectedInvoiceData;
77  }
78 }
$objectManager
Definition: bootstrap.php:17
__construct(ObjectManager $objectManager, EventManagerInterface $eventManager, SalesInvoiceReport $salesInvoiceReport)