Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 6599fc7

Browse files
committed
MAGETWO-75457: [Backport] - Fix for #4530 $product->getRatingSummary() always returns null […] #10248 - for 2.2
- fix after CR
1 parent 4ca8f6a commit 6599fc7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dev/tests/integration/testsuite/Magento/Review/Block/Product/ReviewRendererTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
class ReviewRendererTest extends \PHPUnit\Framework\TestCase
1010
{
1111
/**
12+
* Test verifies ReviewRenderer::getReviewsSummaryHtml call with $displayIfNoReviews = false
13+
* The reviews summary will be shown as expected only if there is at least one review available
14+
*
1215
* @magentoDataFixture Magento/Review/_files/different_reviews.php
1316
* @magentoAppArea frontend
1417
*/
@@ -19,10 +22,10 @@ public function testGetReviewSummaryHtml()
1922
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
2023
$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
2124
$product = $productRepository->get($productSku);
22-
/** @var \Magento\Review\Block\Product\ReviewRenderer $reviewRenderer */
23-
$reviewRenderer = $objectManager->create(\Magento\Review\Block\Product\ReviewRenderer::class);
25+
/** @var ReviewRenderer $reviewRenderer */
26+
$reviewRenderer = $objectManager->create(ReviewRenderer::class);
2427
$actualResult = $reviewRenderer->getReviewsSummaryHtml($product);
2528
$this->assertEquals(2, $reviewRenderer->getReviewsCount());
26-
$this->assertNotEmpty($actualResult);
29+
$this->assertContains('<span itemprop="reviewCount">2</span>', $actualResult);
2730
}
2831
}

0 commit comments

Comments
 (0)