/** * Assert that product review can do approved. * * @param CatalogProductReview $reviewIndex * @param Review $review * @param CatalogProductReviewEdit $reviewEdit * @param AssertReviewSuccessSaveMessage $assertReviewSuccessSaveMessage * @param Cache $cachePage * @return void */ public function processAssert(CatalogProductReview $reviewIndex, Review $review, CatalogProductReviewEdit $reviewEdit, AssertReviewSuccessSaveMessage $assertReviewSuccessSaveMessage, Cache $cachePage) { $reviewIndex->open()->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); $reviewEdit->getReviewForm()->setApproveReview(); $reviewEdit->getFormPageActions()->save(); $assertReviewSuccessSaveMessage->processAssert($reviewIndex); $cachePage->open()->getPageActions()->flushCacheStorage(); }
/** * Assert that review data equals passed from fixture on edit page. * * @param CatalogProductReview $reviewIndex * @param Review $review * @param CatalogProductReviewEdit $reviewEdit * @param string $status [optional] * @return void */ public function processAssert(CatalogProductReview $reviewIndex, Review $review, CatalogProductReviewEdit $reviewEdit, $status = '') { $reviewIndex->open(); $reviewIndex->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); $fixtureData = $this->prepareFixtureData($review, $status); $formData = $reviewEdit->getReviewForm()->getData(); $error = $this->verifyData($fixtureData, $formData); \PHPUnit_Framework_Assert::assertEmpty($error, $error); }
/** * Assert that product rating is displayed on product review(backend) page. * * @param CatalogProductReview $reviewIndex * @param CatalogProductReviewEdit $reviewEdit * @param Review $review * @return void */ public function processAssert(CatalogProductReview $reviewIndex, CatalogProductReviewEdit $reviewEdit, Review $review) { $reviewIndex->open(); $reviewIndex->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); $ratingReview = $this->sortDataByPath($review->getRatings(), '::title'); $ratingForm = $this->sortDataByPath($reviewEdit->getReviewForm()->getData()['ratings'], '::title'); $error = $this->verifyData($ratingReview, $ratingForm); \PHPUnit_Framework_Assert::assertEmpty($error, $error); }
/** * Assert that review is displayed in grid. * * @param CatalogProductReview $reviewIndex * @param Review $review * @param InjectableFixture $product * @param string $gridStatus [optional] * @return void */ public function processAssert(CatalogProductReview $reviewIndex, Review $review, InjectableFixture $product, $gridStatus = '') { $reviewIndex->open(); $filter = $this->prepareFilter($product, $review->getData(), $gridStatus); \PHPUnit_Framework_Assert::assertTrue($reviewIndex->getReviewGrid()->isRowVisible($filter), 'Review is absent in Review grid.'); }