Skip to content

Commit a05b1fb

Browse files
author
Valeriy Nayda
committed
MAGETWO-40177: Prepare pull request
-- fix static tests, fix unit tests
1 parent e284ead commit a05b1fb

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

app/code/Magento/Catalog/Model/Plugin/PageCache/Product/Action.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public function __construct(
3636

3737
/**
3838
* @param Product\Action $subject
39-
* @param callable $proceed
40-
* @param $productIds
41-
* @param $attrData
42-
* @param $storeId
39+
* @param \Closure $proceed
40+
* @param array $productIds
41+
* @param array $attrData
42+
* @param int $storeId
4343
* @return Product\Action
4444
*
4545
* @SuppressWarnings(PHPMD.UnusedFormalParameter)

app/code/Magento/CatalogInventory/Model/Indexer/Stock/AbstractAction.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ abstract class AbstractAction
6969
* @param \Magento\Framework\App\Resource $resource
7070
* @param \Magento\CatalogInventory\Model\Resource\Indexer\StockFactory $indexerFactory
7171
* @param \Magento\Catalog\Model\Product\Type $catalogProductType
72+
* @param \Magento\Indexer\Model\CacheContext $cacheContext
73+
* @param \Magento\Framework\Event\ManagerInterface $eventManager
7274
*/
7375
public function __construct(
7476
\Magento\Framework\App\Resource $resource,
7577
\Magento\CatalogInventory\Model\Resource\Indexer\StockFactory $indexerFactory,
7678
\Magento\Catalog\Model\Product\Type $catalogProductType,
7779
\Magento\Indexer\Model\CacheContext $cacheContext,
7880
\Magento\Framework\Event\ManagerInterface $eventManager
79-
8081
) {
8182
$this->_resource = $resource;
8283
$this->_indexerFactory = $indexerFactory;
@@ -248,7 +249,7 @@ protected function _reindexRows($productIds = [])
248249

249250
$select = $adapter->select()
250251
->distinct(true)
251-
->from($this->_getTable('catalog_category_product'), [ 'category_id'])
252+
->from($this->_getTable('catalog_category_product'), ['category_id'])
252253
->where('product_id IN(?)', $processIds);
253254

254255
$affectedCategories = $adapter->fetchCol($select);

app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/Stock/Action/FullTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,23 @@ public function testExecuteWithAdapterErrorThrowsException()
2525
$adapterMock = $this->getMock('Magento\Framework\DB\Adapter\AdapterInterface');
2626

2727
$exceptionMessage = 'exception message';
28-
$exception = new \Exception($exceptionMessage);
2928

3029
$adapterMock->expects($this->once())
3130
->method('delete')
32-
->will($this->throwException($exception));
31+
->will($this->throwException(new \Exception($exceptionMessage)));
3332

3433
$resourceMock->expects($this->any())
3534
->method('getConnection')
3635
->will($this->returnValue($adapterMock));
3736

38-
$model = new \Magento\CatalogInventory\Model\Indexer\Stock\Action\Full(
39-
$resourceMock,
40-
$indexerFactoryMock,
41-
$productTypeMock
37+
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
38+
$model = $objectManager->getObject(
39+
'Magento\CatalogInventory\Model\Indexer\Stock\Action\Full',
40+
[
41+
'resource' => $resourceMock,
42+
'indexerFactory' => $indexerFactoryMock,
43+
'catalogProductType' => $productTypeMock,
44+
]
4245
);
4346

4447
$this->setExpectedException('\Magento\Framework\Exception\LocalizedException', $exceptionMessage);

0 commit comments

Comments
 (0)