Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertTaxReportNotInGrid.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 AssertTaxReportNotInGrid extends AbstractConstraint
19 {
20  /* tags */
21  const SEVERITY = 'low';
22  /* end tags */
23 
33  public function processAssert(
34  SalesTaxReport $salesTaxReport,
35  OrderInjectable $order,
36  TaxRule $taxRule,
38  ) {
39  $filter = [
40  'tax' => $taxRule->getTaxRate()[0],
41  'rate' => $taxRule->getDataFieldConfig('tax_rate')['source']->getFixture()[0]->getRate(),
42  'orders' => count($order->getEntityId()['products']),
43  'tax_amount' => $taxAmount,
44  ];
45 
46  \PHPUnit\Framework\Assert::assertFalse(
47  $salesTaxReport->getGridBlock()->isRowVisible($filter, false),
48  "Tax Report is visible in grid on tax report page."
49  );
50  }
51 
57  public function toString()
58  {
59  return "Sales info in report: Tax, Rate, Orders, Tax Amount is incorrect in grid on tax report page.";
60  }
61 }
$order
Definition: order.php:55
$taxRule
Definition: tax_rule.php:35
processAssert(SalesTaxReport $salesTaxReport, OrderInjectable $order, TaxRule $taxRule, $taxAmount)