/**
  * Assert that Customer review is displayed in grid
  *
  * @param ReviewIndex $reviewIndex
  * @param Review $review
  * @param AssertProductReviewInGrid $assertProductReviewInGrid
  * @param CustomerReportReview $customerReportReview
  * @param Customer $customer
  * @param CatalogProductSimple $product
  * @param string $gridStatus
  * @return void
  */
 public function processAssert(ReviewIndex $reviewIndex, Review $review, AssertProductReviewInGrid $assertProductReviewInGrid, CustomerReportReview $customerReportReview, Customer $customer, CatalogProductSimple $product = null, $gridStatus = '')
 {
     $filter = $assertProductReviewInGrid->prepareFilter($product, $review->getData(), $gridStatus);
     $customerReportReview->open();
     $customerReportReview->getGridBlock()->openReview($customer);
     $reviewIndex->getReviewGrid()->search($filter);
     unset($filter['visible_in']);
     \PHPUnit_Framework_Assert::assertTrue($reviewIndex->getReviewGrid()->isRowVisible($filter, false), 'Customer review is absent in Review grid.');
 }
 /**
  * Assert that review is visible in review grid for select product
  *
  * @param ReviewIndex $reviewIndex
  * @param Review $review
  * @param ProductReportReview $productReportReview
  * @param AssertProductReviewInGrid $assertProductReviewInGrid
  * @return void
  */
 public function processAssert(ReviewIndex $reviewIndex, Review $review, ProductReportReview $productReportReview, AssertProductReviewInGrid $assertProductReviewInGrid)
 {
     $productReportReview->open();
     $product = $review->getDataFieldConfig('entity_id')['source']->getEntity();
     $productReportReview->getGridBlock()->openReview($product->getName());
     unset($assertProductReviewInGrid->filter['visible_in']);
     $filter = $assertProductReviewInGrid->prepareFilter($product, $review->getData(), '');
     \PHPUnit_Framework_Assert::assertTrue($reviewIndex->getReviewGrid()->isRowVisible($filter, false), 'Review for ' . $product->getName() . ' product is not visible in reports grid.');
 }
 /**
  * Asserts all Product Review variables in the reviews grid on customer page
  *
  * @param Customer $customer
  * @param Review $reviewInitial
  * @param Review $review
  * @param CustomerIndexEdit $customerIndexEdit
  * @param CustomerIndex $customerIndex
  * @param AssertProductReviewInGrid $assertProductReviewInGrid
  * @return void
  */
 public function processAssert(Customer $customer, Review $reviewInitial, Review $review, CustomerIndexEdit $customerIndexEdit, CustomerIndex $customerIndex, AssertProductReviewInGrid $assertProductReviewInGrid)
 {
     /** var CatalogProductSimple $product */
     $product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
     $customerIndex->open();
     $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]);
     $customerIndexEdit->getCustomerForm()->openTab('product_reviews');
     $filter = $assertProductReviewInGrid->prepareFilter($product, $this->prepareData($review, $reviewInitial));
     /** @var ReviewsGrid $reviewsGrid */
     $reviewsGrid = $customerIndexEdit->getCustomerForm()->getTab('product_reviews')->getReviewsGrid();
     $reviewsGrid->search($filter);
     unset($filter['visible_in']);
     \PHPUnit_Framework_Assert::assertTrue($reviewsGrid->isRowVisible($filter, false), 'Review is absent in Review grid on customer page.');
 }