Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertDownloadsReportResult.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Reports\Test\Page\Adminhtml\DownloadsReport;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
17 class AssertDownloadsReportResult extends AbstractConstraint
18 {
19  /* tags */
20  const SEVERITY = 'low';
21  /* end tags */
22 
31  public function processAssert(OrderInjectable $order, DownloadsReport $downloadsReport, $downloads)
32  {
33  $downloadsReport->open();
34  foreach ($order->getEntityId()['products'] as $product) {
35  foreach ($product->getDownloadableLinks()['downloadable']['link'] as $link) {
36  $filter = [
37  'name' => $product->getName(),
38  'link_title' => $link['title'],
39  'sku' => $product->getSku(),
40  ];
41  $downloadsReport->getGridBlock()->search($filter);
42  $filter[] = $downloads;
43  \PHPUnit\Framework\Assert::assertTrue(
44  $downloadsReport->getGridBlock()->isRowVisible($filter, false),
45  "Downloads report link {$link['title']} is not present in reports grid."
46  );
47  }
48  }
49  }
50 
56  public function toString()
57  {
58  return 'Downloads report is present in reports grid.';
59  }
60 }
$order
Definition: order.php:55
processAssert(OrderInjectable $order, DownloadsReport $downloadsReport, $downloads)