當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。