Skip to content

Commit 5bf96e4

Browse files
author
Denys Rudchenko
committed
MAGETWO-36955: Pull request, Nord team sprint 20
1 parent 723222a commit 5bf96e4

File tree

3 files changed

+10
-44
lines changed

3 files changed

+10
-44
lines changed

dev/tests/integration/testsuite/Magento/Review/Model/Resource/Rating/CollectionTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function setUp()
2020
}
2121

2222
/**
23-
* @magentoDataFixture Magento/Review/_files/customer_rating.php
23+
* @magentoDataFixture Magento/Review/_files/customer_review_with_rating.php
2424
*/
2525
public function testAddEntitySummaryToItem()
2626
{
@@ -32,6 +32,9 @@ public function testAddEntitySummaryToItem()
3232
$this->assertEquals($this->collection, $result);
3333
}
3434

35+
/**
36+
* @magentoDbIsolation enabled
37+
*/
3538
public function testAddEntitySummaryToItemEmpty()
3639
{
3740
foreach ($this->collection->getItems() as $item) {

dev/tests/integration/testsuite/Magento/Review/_files/customer_rating.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

dev/tests/integration/testsuite/Magento/Review/_files/customer_review_with_rating.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
$review
3838
);
3939

40+
/** @var \Magento\Review\Model\Resource\Review\Collection $ratingCollection */
4041
$ratingCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
4142
'\Magento\Review\Model\Rating'
4243
)->getCollection()
@@ -58,3 +59,8 @@
5859
$rating->setReviewId($review->getId())
5960
->addOptionVote($ratingOption->getId(), $product->getId());
6061
}
62+
63+
\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Registry')->register(
64+
'rating_data',
65+
$ratingCollection->getFirstItem()
66+
);

0 commit comments

Comments
 (0)