Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertTaxReportInGrid.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Reports\Test\Page\Adminhtml\SalesTaxReport;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 
18 class AssertTaxReportInGrid extends AbstractConstraint
19 {
29  public function processAssert(
30  SalesTaxReport $salesTaxReport,
31  OrderInjectable $order,
32  TaxRule $taxRule,
34  ) {
35  $filter = [
36  'tax' => $taxRule->getTaxRate()[0],
37  'rate' => $taxRule->getDataFieldConfig('tax_rate')['source']->getFixture()[0]->getRate(),
38  'orders' => count($order->getEntityId()['products']),
39  'tax_amount' => $taxAmount,
40  ];
41 
42  \PHPUnit\Framework\Assert::assertTrue(
43  $salesTaxReport->getGridBlock()->isRowVisible($filter, false),
44  "Tax Report is not visible in grid on tax report page."
45  );
46  }
47 
53  public function toString()
54  {
55  return "Sales info in report: Tax, Rate, Orders, Tax Amount is correct in grid on tax report page.";
56  }
57 }
$order
Definition: order.php:55
$taxRule
Definition: tax_rule.php:35
processAssert(SalesTaxReport $salesTaxReport, OrderInjectable $order, TaxRule $taxRule, $taxAmount)