Ejemplo n.º 1
0
 public function testGetReviewsSummaryHtml()
 {
     $this->_block->setLayout(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\View\\LayoutInterface'));
     $html = $this->_block->getReviewsSummaryHtml($this->_product, false, true);
     $this->assertNotEmpty($html);
     $this->assertContains('review', $html);
 }
Ejemplo n.º 2
0
 /**
  * Get product reviews summary
  *
  * @param \Magento\Catalog\Model\Product $product
  * @param bool $templateType
  * @param bool $displayIfNoReviews
  * @return string
  */
 public function getReviewsSummaryHtml(\Magento\Catalog\Model\Product $product, $templateType = false, $displayIfNoReviews = false)
 {
     if (!$product->getRatingSummary()) {
         $this->_reviewFactory->create()->getEntitySummary($product, $this->_storeManager->getStore()->getId());
     }
     return parent::getReviewsSummaryHtml($product, $templateType, $displayIfNoReviews);
 }