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); }
/** * 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); }