Skip to content

Commit c8290db

Browse files
akaplyavaldislav
authored andcommitted
MAGETWO-36882: Stabilizing branch
1 parent 441b511 commit c8290db

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

app/code/Magento/Sales/Test/Unit/Model/Resource/HelperTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ class HelperTest extends \PHPUnit_Framework_TestCase
2222
*/
2323
private $appResource;
2424

25+
/**
26+
* @var \Magento\Framework\DB\Adapter\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject
27+
*/
28+
private $adapterMock;
29+
2530
/**
2631
* @var \Magento\Sales\Model\Resource\Helper
2732
*/
@@ -49,6 +54,14 @@ protected function setUp()
4954
false
5055
);
5156

57+
$this->adapterMock = $this->getMock(
58+
'Magento\Framework\DB\Adapter\Pdo\Mysql',
59+
[],
60+
[],
61+
'',
62+
false
63+
);
64+
5265
$this->helper = $objectManager->getObject(
5366
'Magento\Sales\Model\Resource\Helper',
5467
[
@@ -70,11 +83,16 @@ public function testGetBestsellersReportUpdateRatingPos($aggregation, $aggregati
7083
$mainTable = 'main_table';
7184
$aggregationTable = 'aggregation_table';
7285
$this->resourceHelper->expects($this->once())->method('updateReportRatingPos')->with(
86+
$this->adapterMock,
7387
$expectedType,
7488
'qty_ordered',
7589
$mainTable,
7690
$aggregationTable
7791
);
92+
$this->appResource->expects($this->once())
93+
->method('getConnection')
94+
->with('sales_write')
95+
->willReturn($this->adapterMock);
7896
$this->helper->getBestsellersReportUpdateRatingPos(
7997
$aggregation,
8098
$aggregationAliases,

0 commit comments

Comments
 (0)