Skip to content

Commit ad015e8

Browse files
author
Roman Ganin
committed
MAGETWO-33690: Category page displays outdated prices after catalog price rule is deleted
- codestyle fixes
1 parent 86eb0ef commit ad015e8

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed

app/code/Magento/CatalogRule/Model/Indexer/AbstractIndexer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ abstract class AbstractIndexer implements IndexerActionInterface, MviewActionInt
2525

2626
/**
2727
* @param IndexBuilder $indexBuilder
28+
* @param \Magento\Framework\Event\ManagerInterface $eventManager
2829
*/
2930
public function __construct(
3031
IndexBuilder $indexBuilder,

app/code/Magento/CatalogRule/Model/Rule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel
163163
* @param \Magento\CatalogRule\Helper\Data $catalogRuleData
164164
* @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypesList
165165
* @param \Magento\Framework\Stdlib\DateTime $dateTime
166-
* @param \Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor
166+
* @param \Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor $ruleProductProcessor
167167
* @param \Magento\Framework\Model\Resource\AbstractResource $resource
168168
* @param \Magento\Framework\Data\Collection\Db $resourceCollection
169169
* @param array $relatedCacheTypes

app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/AbstractIndexerTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ class AbstractIndexerTest extends \PHPUnit_Framework_TestCase
2323
*/
2424
protected $_eventManagerMock;
2525

26+
/**
27+
* Set up test
28+
*
29+
* @return void
30+
*/
2631
protected function setUp()
2732
{
2833
$this->_eventManagerMock = $this->getMock('\Magento\Framework\Event\ManagerInterface');
@@ -37,6 +42,11 @@ protected function setUp()
3742
);
3843
}
3944

45+
/**
46+
* Test execute
47+
*
48+
* @return void
49+
*/
4050
public function testExecute()
4151
{
4252
$ids = [1, 2, 5];
@@ -45,6 +55,11 @@ public function testExecute()
4555
$this->indexer->execute($ids);
4656
}
4757

58+
/**
59+
* Test execute full reindex action
60+
*
61+
* @return void
62+
*/
4863
public function testExecuteFull()
4964
{
5065
$this->indexBuilder->expects($this->once())->method('reindexFull');
@@ -61,12 +76,19 @@ public function testExecuteFull()
6176
/**
6277
* @expectedException \Magento\CatalogRule\CatalogRuleException
6378
* @expectedExceptionMessage Could not rebuild index for empty products array
79+
*
80+
* @return void
6481
*/
6582
public function testExecuteListWithEmptyIds()
6683
{
6784
$this->indexer->executeList([]);
6885
}
6986

87+
/**
88+
* @throws \Magento\CatalogRule\CatalogRuleException
89+
*
90+
* @return void
91+
*/
7092
public function testExecuteList()
7193
{
7294
$ids = [1, 2, 5];
@@ -78,12 +100,19 @@ public function testExecuteList()
78100
/**
79101
* @expectedException \Magento\CatalogRule\CatalogRuleException
80102
* @expectedExceptionMessage Could not rebuild index for undefined product
103+
*
104+
* @return void
81105
*/
82106
public function testExecuteRowWithEmptyId()
83107
{
84108
$this->indexer->executeRow(null);
85109
}
86110

111+
/**
112+
* @throws \Magento\CatalogRule\CatalogRuleException
113+
*
114+
* @return void
115+
*/
87116
public function testExecuteRow()
88117
{
89118
$id = 5;

app/code/Magento/CatalogRule/Test/Unit/Model/RuleTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ class RuleTest extends \PHPUnit_Framework_TestCase
5151
*/
5252
protected $productModel;
5353

54+
/**
55+
* Set up before test
56+
*
57+
* @return void
58+
*/
5459
protected function setUp()
5560
{
5661
$this->storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface');
@@ -134,6 +139,8 @@ protected function setUp()
134139
/**
135140
* @dataProvider dataProviderCallbackValidateProduct
136141
* @param bool $validate
142+
*
143+
* @return void
137144
*/
138145
public function testCallbackValidateProduct($validate)
139146
{
@@ -180,6 +187,11 @@ public function testCallbackValidateProduct($validate)
180187
}
181188
}
182189

190+
/**
191+
* Data provider for callbackValidateProduct test
192+
*
193+
* @return array
194+
*/
183195
public function dataProviderCallbackValidateProduct()
184196
{
185197
return [
@@ -188,6 +200,11 @@ public function dataProviderCallbackValidateProduct()
188200
];
189201
}
190202

203+
/**
204+
* Test after delete action
205+
*
206+
* @return void
207+
*/
191208
public function testAfterDelete()
192209
{
193210
$indexer = $this->getMock('\Magento\Indexer\Model\IndexerInterface');
@@ -196,6 +213,11 @@ public function testAfterDelete()
196213
$this->rule->afterDelete();
197214
}
198215

216+
/**
217+
* Test after update action
218+
*
219+
* @return void
220+
*/
199221
public function testAfterUpdate()
200222
{
201223
$this->rule->isObjectNew(false);

0 commit comments

Comments
 (0)