/** * Injection data * * @param ReviewIndex $reviewIndex * @param RatingIndex $ratingIndex * @param RatingEdit $ratingEdit * @param ReviewInjectable $review * @return array */ public function __inject(ReviewIndex $reviewIndex, RatingIndex $ratingIndex, RatingEdit $ratingEdit, ReviewInjectable $review) { $this->reviewIndex = $reviewIndex; $this->ratingIndex = $ratingIndex; $this->ratingEdit = $ratingEdit; $this->review = $review; $this->review->persist(); return ['review' => $this->review]; }
/** * Injection data * * @param ReviewIndex $reviewIndex * @param RatingIndex $ratingIndex * @param RatingEdit $ratingEdit * @param ReviewInjectable $review * @return array */ public function __inject(ReviewIndex $reviewIndex, RatingIndex $ratingIndex, RatingEdit $ratingEdit, ReviewInjectable $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 ReviewInjectable $reviewInitial * @param ReviewInjectable $review * @return void */ public function test(ReviewInjectable $reviewInitial, ReviewInjectable $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(); }
/** * Creation product review report entity * * @param ReviewInjectable $review * @return void */ public function test(ReviewInjectable $review) { // Preconditions $review->persist(); }
/** * Run create frontend product rating test * * @param ReviewInjectable $reviewInitial * @param ReviewInjectable $review * @return array */ public function test(ReviewInjectable $reviewInitial, ReviewInjectable $review) { // Precondition $reviewInitial->persist(); // Prepare for tear down $this->review = $reviewInitial; // 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('reviewInjectable', ['dataSet' => 'review_for_simple_product_with_rating']); $this->reviewInitial->persist(); $this->fixtureFactory = $fixtureFactory; }