/**
  * Injection data.
  *
  * @param ReviewIndex $reviewIndex
  * @param RatingIndex $ratingIndex
  * @param RatingEdit $ratingEdit
  * @param Review $review
  * @return array
  */
 public function __inject(ReviewIndex $reviewIndex, RatingIndex $ratingIndex, RatingEdit $ratingEdit, Review $review)
 {
     $this->reviewIndex = $reviewIndex;
     $this->ratingIndex = $ratingIndex;
     $this->ratingEdit = $ratingEdit;
     $this->review = $review;
     $this->review->persist();
     $product = $review->getDataFieldConfig('entity_id')['source']->getEntity();
     return ['review' => $this->review, 'product' => $product];
 }
 /**
  * Run moderate product review test.
  *
  * @param Review $reviewInitial
  * @param Review $review
  * @return array
  */
 public function test(Review $reviewInitial, Review $review)
 {
     // Precondition
     $reviewInitial->persist();
     // Steps
     $this->reviewIndex->open();
     $this->reviewIndex->getReviewGrid()->searchAndOpen(['review_id' => $reviewInitial->getReviewId()]);
     $this->reviewEdit->getReviewForm()->fill($review);
     $this->reviewEdit->getPageActions()->save();
     // Prepare data for asserts
     $product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
     return ['product' => $product];
 }
 /**
  * Prepare data.
  *
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function __prepare(FixtureFactory $fixtureFactory)
 {
     $this->reviewInitial = $fixtureFactory->createByCode('review', ['dataset' => 'review_for_simple_product_with_rating']);
     $this->reviewInitial->persist();
     $this->fixtureFactory = $fixtureFactory;
 }
 /**
  * Creation product review report entity
  *
  * @param Review $review
  * @return void
  */
 public function test(Review $review)
 {
     // Preconditions
     $review->persist();
 }