当前位置: 首页>>代码示例>>PHP>>正文


PHP CatalogProductView::getReviewsBlock方法代码示例

本文整理汇总了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);
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:19,代码来源:AssertProductReviewOnProductPage.php

示例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.');
     }
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:21,代码来源:AssertProductRatingInProductPage.php

示例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];
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:19,代码来源:AddFrontendReviewStep.php

示例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));
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:11,代码来源:AssertProductReviewIsAbsentOnProductPage.php


注:本文中的mage\catalog\test\page\product\CatalogProductView::getReviewsBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。