/**
  * Assert bestseller info in report: date, product name and qty.
  *
  * @param Bestsellers $bestsellers
  * @param OrderInjectable $order
  * @param string $date
  * @return void
  */
 public function processAssert(Bestsellers $bestsellers, OrderInjectable $order, $date)
 {
     /** @var CatalogProductSimple $product */
     $product = $order->getEntityId()['products'][0];
     $filter = ['date' => date($date), 'product' => $product->getName(), 'price' => $product->getPrice(), 'orders' => $product->getCheckoutData()['qty']];
     \PHPUnit_Framework_Assert::assertTrue($bestsellers->getGridBlock()->isRowVisible($filter, false), 'Bestseller does not present in report grid.');
 }
 /**
  * Bestseller Products Report.
  *
  * @param OrderInjectable $order
  * @param array $bestsellerReport
  * @return void
  */
 public function test(OrderInjectable $order, array $bestsellerReport)
 {
     // Preconditions
     $order->persist();
     $this->bestsellers->open();
     $this->bestsellers->getMessagesBlock()->clickLinkInMessages('notice', 'here');
     // Steps
     $this->bestsellers->getFilterBlock()->viewsReport($bestsellerReport);
     $this->bestsellers->getActionsBlock()->showReport();
 }
 /**
  * Assert bestseller info in report: date, product name and qty
  *
  * @param Bestsellers $bestsellers
  * @param OrderInjectable $order
  * @param string $date
  * @return void
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function processAssert(Bestsellers $bestsellers, OrderInjectable $order, $date)
 {
     $products = $order->getEntityId()['products'];
     $totalQuantity = $bestsellers->getGridBlock()->getViewsResults($products, $date);
     $productQty = [];
     foreach ($products as $key => $product) {
         /** @var CatalogProductSimple $product*/
         $productQty[$key] = $product->getCheckoutData()['qty'];
     }
     \PHPUnit_Framework_Assert::assertEquals($productQty, $totalQuantity);
 }