Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertBestsellerReportResult.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Reports\Test\Page\Adminhtml\Bestsellers;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 
17 class AssertBestsellerReportResult extends AbstractConstraint
18 {
27  public function processAssert(Bestsellers $bestsellers, OrderInjectable $order, $date)
28  {
30  $product = $order->getEntityId()['products'][0];
31 
32  $filter = [
33  'date' => date($date),
34  'product' => $product->getName(),
35  'price' => $product->getPrice(),
36  'orders' => $product->getCheckoutData()['qty'],
37  ];
38 
39  \PHPUnit\Framework\Assert::assertTrue(
40  $bestsellers->getGridBlock()->isRowVisible($filter, false),
41  'Bestseller does not present in report grid.'
42  );
43  }
44 
50  public function toString()
51  {
52  return 'Bestseller total result is equals to data from dataset.';
53  }
54 }
$order
Definition: order.php:55