本文整理汇总了PHP中mage\catalog\test\page\product\CatalogProductView::getReviewsBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogProductView::getReviewsBlock方法的具体用法?PHP CatalogProductView::getReviewsBlock怎么用?PHP CatalogProductView::getReviewsBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mage\catalog\test\page\product\CatalogProductView
的用法示例。
在下文中一共展示了CatalogProductView::getReviewsBlock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processAssert
/**
* Assert that product review available on product page.
*
* @param CatalogProductView $catalogProductView
* @param Review $review
* @param FixtureInterface $product
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, Review $review, FixtureInterface $product, BrowserInterface $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$reviewBlock = $catalogProductView->getReviewsBlock();
$catalogProductView->getViewBlock()->openCustomInformationTab('Reviews');
$formReview = $reviewBlock->getItems()[0];
$fixtureReview = $this->prepareReview($review);
$errors = $this->verifyData($fixtureReview, $formReview);
\PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
}
示例2: processAssert
/**
* Assert that product rating is displayed on product review page(frontend).
*
* @param CatalogProductView $catalogProductView
* @param ReviewProductList $reviewProductList
* @param BrowserInterface $browser
* @param CatalogProductSimple $product
* @param Review $review
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, ReviewProductList $reviewProductList, BrowserInterface $browser, CatalogProductSimple $product, Review $review)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->openCustomInformationTab('Reviews');
$catalogProductView->getReviewsBlock()->clickAddReviewLink();
$reviewForm = $reviewProductList->getReviewFormBlock();
$ratings = $review->getDataFieldConfig('ratings')['source']->getRatings();
foreach ($ratings as $rating) {
\PHPUnit_Framework_Assert::assertTrue($reviewForm->isVisibleRating($rating), 'Product rating "' . $rating->getRatingCode() . '" is not displayed on review product page.');
}
}
示例3: run
/**
* Add review to product via frontend.
*
* @return array
*/
public function run()
{
$product = $this->review->getDataFieldConfig('entity_id')['source']->getEntity();
$this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
if ($this->isFirstReview) {
$this->assertProductReviewIsAbsentOnProductPage->processAssert();
}
$this->catalogProductView->getViewBlock()->openCustomInformationTab('Reviews');
$this->catalogProductView->getReviewsBlock()->clickAddReviewLink();
$reviewForm = $this->reviewProductList->getReviewFormBlock();
$reviewForm->fill($this->review);
$reviewForm->submit();
return ['product' => $product, 'review' => $this->review];
}
示例4: processAssert
/**
* Assert that product doesn't have a review on product page.
*
* @return void
*/
public function processAssert()
{
$this->catalogProductView->getViewBlock()->openCustomInformationTab('Reviews');
\PHPUnit_Framework_Assert::assertFalse($this->catalogProductView->getReviewsBlock()->isVisibleReviewItems(), 'No reviews below the form required.');
\PHPUnit_Framework_Assert::assertEquals(self::NO_REVIEW_LINK_TEXT, trim($this->catalogProductView->getReviewsBlock()->getAddReviewLink()->getText()), sprintf('"%s" link is not available', self::NO_REVIEW_LINK_TEXT));
}