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


PHP CatalogProductView::getReviewSummary方法代码示例

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


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

示例1: processAssert

 /**
  * Assert that add view review links are present on product page.
  *
  * @param Browser $browser
  * @param CatalogProductView $catalogProductView
  * @param InjectableFixture $product
  * @return void
  */
 public function processAssert(Browser $browser, CatalogProductView $catalogProductView, InjectableFixture $product)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     // Verify add review link
     \PHPUnit_Framework_Assert::assertTrue($catalogProductView->getReviewSummary()->getAddReviewLink()->isVisible(), 'Add review link is not visible on product page.');
     // Verify view review link
     $viewReviewLink = $catalogProductView->getReviewSummary()->getViewReviewLink();
     \PHPUnit_Framework_Assert::assertTrue($viewReviewLink->isVisible(), 'View review link is not visible on product page.');
     \PHPUnit_Framework_Assert::assertContains('1', $viewReviewLink->getText(), 'There is more than 1 approved review.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:18,代码来源:AssertReviewLinksIsPresentOnProductPage.php

示例2: processAssert

 /**
  * Assert that product rating is not displayed on frontend on product review
  *
  * @param CatalogProductView $catalogProductView
  * @param CatalogProductSimple $product
  * @param Rating $productRating
  * @param BrowserInterface $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, CatalogProductSimple $product, Rating $productRating, BrowserInterface $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getReviewSummary()->getAddReviewLink()->click();
     $reviewForm = $catalogProductView->getReviewFormBlock();
     \PHPUnit_Framework_Assert::assertFalse($reviewForm->isVisibleRating($productRating), 'Product rating "' . $productRating->getRatingCode() . '" is displayed.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:16,代码来源:AssertProductRatingNotInProductPage.php

示例3: processAssert

 /**
  * Assert that product rating is not displayed on frontend on product review
  *
  * @param CatalogProductView $catalogProductView
  * @param CatalogProductSimple $product
  * @param Rating $productRating
  * @param Browser $browser
  * @param ReviewInjectable $review
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, CatalogProductSimple $product, Rating $productRating, Browser $browser, ReviewInjectable $review = null)
 {
     $product = $review === null ? $product : $review->getDataFieldConfig('entity_id')['source']->getEntity();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $catalogProductView->getReviewSummary()->getAddReviewLink()->click();
     $reviewForm = $catalogProductView->getReviewFormBlock();
     \PHPUnit_Framework_Assert::assertFalse($reviewForm->isVisibleRating($productRating), 'Product rating "' . $productRating->getRatingCode() . '" is displayed.');
 }
开发者ID:aiesh,项目名称:magento2,代码行数:18,代码来源:AssertProductRatingNotInProductPage.php

示例4: processAssert

 /**
  * Assert that product rating is displayed on product review(frontend)
  *
  * @param CatalogProductView $catalogProductView
  * @param BrowserInterface $browser
  * @param CatalogProductSimple $product
  * @param Review|null $review [optional]
  * @param Rating|null $productRating [optional]
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, BrowserInterface $browser, CatalogProductSimple $product, Review $review = null, Rating $productRating = null)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $reviewSummaryBlock = $catalogProductView->getReviewSummary();
     if ($reviewSummaryBlock->isVisible()) {
         $reviewSummaryBlock->getAddReviewLink()->click();
     }
     $rating = $productRating ? $productRating : $review->getDataFieldConfig('ratings')['source']->getRatings()[0];
     $reviewForm = $catalogProductView->getReviewFormBlock();
     \PHPUnit_Framework_Assert::assertTrue($reviewForm->isVisibleRating($rating), 'Product rating "' . $rating->getRatingCode() . '" is not displayed.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:21,代码来源:AssertProductRatingInProductPage.php

示例5: test

 /**
  * Run create frontend product rating test.
  *
  * @param Review $review
  * @param BrowserInterface $browser
  * @param AssertProductReviewIsAbsentOnProductPage $assertProductReviewIsAbsentOnProductPage
  * @return array
  */
 public function test(Review $review, BrowserInterface $browser, AssertProductReviewIsAbsentOnProductPage $assertProductReviewIsAbsentOnProductPage)
 {
     // Prepare for tear down
     $this->review = $review;
     // Steps
     $product = $review->getDataFieldConfig('entity_id')['source']->getEntity();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $assertProductReviewIsAbsentOnProductPage->processAssert($this->catalogProductView);
     $this->catalogProductView->getReviewSummary()->clickAddReviewLink();
     $reviewForm = $this->catalogProductView->getReviewFormBlock();
     $reviewForm->fill($review);
     $reviewForm->submit();
     return ['product' => $product];
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:22,代码来源:CreateProductReviewFrontendEntityTest.php

示例6: test

 /**
  * Run create frontend product rating test
  *
  * @param ReviewInjectable $review
  * @param Browser $browser
  * @return void
  */
 public function test(ReviewInjectable $review, Browser $browser)
 {
     // Prepare for tear down
     $this->review = $review;
     // Steps
     $product = $review->getDataFieldConfig('entity_id')['source']->getEntity();
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $reviewLink = $this->catalogProductView->getReviewSummary()->getAddReviewLink();
     if ($reviewLink->isVisible()) {
         $reviewLink->click();
     }
     $reviewForm = $this->catalogProductView->getReviewFormBlock();
     $reviewForm->fill($review);
     $reviewForm->submit();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:22,代码来源:CreateProductReviewFrontendEntityTest.php

示例7: test

 /**
  * Test Creation for CustomerReviewReportEntity
  *
  * @param Review $review
  * @param Customer $customer
  * @param $customerLogin
  * @param CatalogProductSimple $product
  * @param BrowserInterface $browser
  * @return array
  *
  * @SuppressWarnings(PHPMD.ConstructorWithNameAsEnclosingClass)
  */
 public function test(Review $review, Customer $customer, CatalogProductSimple $product, BrowserInterface $browser, $customerLogin)
 {
     // Preconditions
     $product->persist();
     $this->cmsIndex->open();
     if ($customerLogin == 'Yes') {
         $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     }
     // Steps
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $this->pageCatalogProductView->getReviewSummary()->getAddReviewLink()->click();
     $this->pageCatalogProductView->getReviewFormBlock()->fill($review);
     $this->pageCatalogProductView->getReviewFormBlock()->submit();
     return ['product' => $product];
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:27,代码来源:CustomerReviewReportEntityTest.php

示例8: test

 /**
  * Test Creation for CustomerReviewReportEntity
  *
  * @param Review $review
  * @param Customer $customer
  * @param $customerLogin
  * @param CatalogProductSimple $product
  * @param BrowserInterface $browser
  * @return array
  *
  * @SuppressWarnings(PHPMD.ConstructorWithNameAsEnclosingClass)
  */
 public function test(Review $review, Customer $customer, CatalogProductSimple $product, BrowserInterface $browser, $customerLogin)
 {
     // Preconditions
     $product->persist();
     $this->cmsIndex->open();
     if ($customerLogin == 'Yes') {
         $this->cmsIndex->getLinksBlock()->openLink("Log In");
         $this->customerAccountLogin->getLoginBlock()->login($customer);
     }
     // Steps
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $this->pageCatalogProductView->getReviewSummary()->getAddReviewLink()->click();
     $this->pageCatalogProductView->getReviewFormBlock()->fill($review);
     $this->pageCatalogProductView->getReviewFormBlock()->submit();
     return ['product' => $product];
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:28,代码来源:CustomerReviewReportEntityTest.php

示例9: test

 /**
  * Run manage product review test
  *
  * @param Review $reviewInitial
  * @param Review $review
  * @param Customer $customer
  * @return array
  */
 public function test(Review $reviewInitial, Review $review, Customer $customer)
 {
     // Preconditions
     $this->login($customer);
     /** @var CatalogProductSimple $product */
     $product = $reviewInitial->getDataFieldConfig('entity_id')['source']->getEntity();
     $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $this->catalogProductView->getReviewSummary()->getAddReviewLink()->click();
     $this->catalogProductView->getReviewFormBlock()->fill($reviewInitial);
     $this->catalogProductView->getReviewFormBlock()->submit();
     $this->reviewInitial = $reviewInitial;
     // Steps
     $this->customerIndex->open();
     $this->customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]);
     $this->customerIndexEdit->getCustomerForm()->openTab('product_reviews');
     $filter = ['title' => $reviewInitial->getTitle(), 'sku' => $product->getSku()];
     $this->customerIndexEdit->getCustomerForm()->getTabElement('product_reviews')->getReviewsGrid()->searchAndOpen($filter);
     $this->reviewEdit->getReviewForm()->fill($review);
     $this->reviewEdit->getPageActions()->save();
     return ['reviewInitial' => $reviewInitial, 'product' => $product];
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:29,代码来源:ManageProductReviewFromCustomerPageTest.php

示例10: 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::getReviewSummary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。