Skip to content

Commit b9b5c50

Browse files
committed
MC-38168: Manual Indexer after Merchandising - Empty Catalog/ Number of products incorrect
1 parent eb1af21 commit b9b5c50

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\Indexer\ConfigInterface;
1313
use Magento\Framework\Indexer\StateInterface;
1414
use Magento\Framework\Indexer\StructureFactory;
15+
use Magento\Framework\Indexer\IndexerInterfaceFactory;
1516
use Magento\Framework\Mview\ViewInterface;
1617
use Magento\Indexer\Model\Indexer;
1718
use Magento\Indexer\Model\Indexer\CollectionFactory;
@@ -61,6 +62,11 @@ class IndexerTest extends TestCase
6162
*/
6263
private $workingStateProvider;
6364

65+
/**
66+
* @var IndexerInterfaceFactory|MockObject
67+
*/
68+
private $indexerFactoryMock;
69+
6470
protected function setUp(): void
6571
{
6672
$this->workingStateProvider = $this->getMockBuilder(WorkingStateProvider::class)
@@ -79,6 +85,10 @@ protected function setUp(): void
7985
ActionFactory::class,
8086
['create']
8187
);
88+
$this->indexerFactoryMock = $this->createPartialMock(
89+
IndexerInterfaceFactory::class,
90+
['create']
91+
);
8292
$this->viewMock = $this->getMockForAbstractClass(
8393
ViewInterface::class,
8494
[],
@@ -109,7 +119,8 @@ protected function setUp(): void
109119
$this->viewMock,
110120
$this->stateFactoryMock,
111121
$this->indexFactoryMock,
112-
$this->workingStateProvider
122+
$this->workingStateProvider,
123+
$this->indexerFactoryMock
113124
);
114125
}
115126

@@ -356,7 +367,7 @@ protected function getIndexerData()
356367
protected function loadIndexer($indexId)
357368
{
358369
$this->configMock->expects(
359-
$this->once()
370+
$this->any()
360371
)->method(
361372
'getIndexer'
362373
)->with(

0 commit comments

Comments
 (0)