This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
dev/tests/integration/testsuite/Magento/Review/Block/Product Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 9
9
class ReviewRendererTest extends \PHPUnit \Framework \TestCase
10
10
{
11
11
/**
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
+ *
12
15
* @magentoDataFixture Magento/Review/_files/different_reviews.php
13
16
* @magentoAppArea frontend
14
17
*/
@@ -19,10 +22,10 @@ public function testGetReviewSummaryHtml()
19
22
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
20
23
$ productRepository = $ objectManager ->create (\Magento \Catalog \Api \ProductRepositoryInterface::class);
21
24
$ 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);
24
27
$ actualResult = $ reviewRenderer ->getReviewsSummaryHtml ($ product );
25
28
$ this ->assertEquals (2 , $ reviewRenderer ->getReviewsCount ());
26
- $ this ->assertNotEmpty ( $ actualResult );
29
+ $ this ->assertContains ( ' <span itemprop="reviewCount">2</span> ' , $ actualResult );
27
30
}
28
31
}
You can’t perform that action at this time.
0 commit comments