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


PHP CatalogProductView::getCustomerReviewBlock方法代码示例

本文整理汇总了PHP中Magento\Catalog\Test\Page\Product\CatalogProductView::getCustomerReviewBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CatalogProductView::getCustomerReviewBlock方法的具体用法?PHP CatalogProductView::getCustomerReviewBlock怎么用?PHP CatalogProductView::getCustomerReviewBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Catalog\Test\Page\Product\CatalogProductView的用法示例。


在下文中一共展示了CatalogProductView::getCustomerReviewBlock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processAssert

 /**
  * Assert that product review Not available on product page
  *
  * @param CatalogProductView $catalogProductView
  * @param ReviewInjectable $reviewInitial
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, ReviewInjectable $reviewInitial, Browser $browser)
 {
     /** @var CatalogProductSimple $product */
     $product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $reviewBlock = $catalogProductView->getCustomerReviewBlock();
     $catalogProductView->getViewBlock()->selectTab('Reviews');
     \PHPUnit_Framework_Assert::assertFalse($reviewBlock->isVisibleReviewItem(), 'Error, product review is displayed.');
 }
开发者ID:aiesh,项目名称:magento2,代码行数:17,代码来源:AssertProductReviewNotOnProductPage.php

示例2: processAssert

 /**
  * Assert that product review available on product page
  *
  * @param CatalogProductView $catalogProductView
  * @param ReviewInjectable $review
  * @param FixtureInterface $product
  * @param Browser $browser
  * @param AdminCache $cachePage
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, ReviewInjectable $review, FixtureInterface $product, Browser $browser, AdminCache $cachePage)
 {
     $errors = [];
     $cachePage->open()->getActionsBlock()->flushMagentoCache();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $reviewBlock = $catalogProductView->getCustomerReviewBlock();
     $catalogProductView->getViewBlock()->selectTab('Reviews');
     foreach ($review->getData() as $name => $value) {
         $reviewValue = $reviewBlock->getFieldValue($name);
         if ($reviewValue !== null && 0 !== strcasecmp($value, trim($reviewValue))) {
             $errors[] = '- field "' . $name . '" is not equals submitted one, error value "' . $value . '"';
         }
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, 'The Review contains the following errors:' . PHP_EOL . implode(PHP_EOL, $errors));
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:25,代码来源:AssertProductReviewOnProductPage.php

示例3: processAssert

 /**
  * Assert that product review available on product page
  *
  * @param CatalogProductView $catalogProductView
  * @param ReviewInjectable $review
  * @param ReviewInjectable $reviewInitial
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, ReviewInjectable $review, ReviewInjectable $reviewInitial, Browser $browser)
 {
     $errors = [];
     /** @var CatalogProductSimple $product */
     $product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $reviewBlock = $catalogProductView->getCustomerReviewBlock();
     $catalogProductView->getViewBlock()->selectTab('Reviews');
     foreach ($review->getData() as $name => $value) {
         $reviewValue = $reviewBlock->getFieldValue($name);
         if ($reviewValue !== null && 0 !== strcasecmp($value, trim($reviewValue))) {
             $errors[] = '- field "' . $name . '" is not equals submitted one, error value "' . $value . '"';
         }
     }
     \PHPUnit_Framework_Assert::assertEmpty($errors, 'The Review contains the following errors:' . PHP_EOL . implode(PHP_EOL, $errors));
 }
开发者ID:aiesh,项目名称:magento2,代码行数:25,代码来源:AssertProductReviewOnProductPage.php

示例4: processAssert

 /**
  * Assert that product doesn't have a review on product page.
  *
  * @param CatalogProductView $catalogProductView
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView)
 {
     $catalogProductView->getViewBlock()->selectTab('Reviews');
     \PHPUnit_Framework_Assert::assertFalse($catalogProductView->getCustomerReviewBlock()->isVisibleReviewItem(), 'No reviews below the form required.');
     \PHPUnit_Framework_Assert::assertEquals(self::NO_REVIEW_LINK_TEXT, trim($catalogProductView->getReviewSummary()->getAddReviewLink()->getText()), sprintf('"%s" link is not available', self::NO_REVIEW_LINK_TEXT));
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:AssertProductReviewIsAbsentOnProductPage.php


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