12
12
use Magento \Framework \Indexer \ConfigInterface ;
13
13
use Magento \Framework \Indexer \StateInterface ;
14
14
use Magento \Framework \Indexer \StructureFactory ;
15
+ use Magento \Framework \Indexer \IndexerInterfaceFactory ;
15
16
use Magento \Framework \Mview \ViewInterface ;
16
17
use Magento \Indexer \Model \Indexer ;
17
18
use Magento \Indexer \Model \Indexer \CollectionFactory ;
@@ -61,6 +62,11 @@ class IndexerTest extends TestCase
61
62
*/
62
63
private $ workingStateProvider ;
63
64
65
+ /**
66
+ * @var IndexerInterfaceFactory|MockObject
67
+ */
68
+ private $ indexerFactoryMock ;
69
+
64
70
protected function setUp (): void
65
71
{
66
72
$ this ->workingStateProvider = $ this ->getMockBuilder (WorkingStateProvider::class)
@@ -79,6 +85,10 @@ protected function setUp(): void
79
85
ActionFactory::class,
80
86
['create ' ]
81
87
);
88
+ $ this ->indexerFactoryMock = $ this ->createPartialMock (
89
+ IndexerInterfaceFactory::class,
90
+ ['create ' ]
91
+ );
82
92
$ this ->viewMock = $ this ->getMockForAbstractClass (
83
93
ViewInterface::class,
84
94
[],
@@ -109,7 +119,8 @@ protected function setUp(): void
109
119
$ this ->viewMock ,
110
120
$ this ->stateFactoryMock ,
111
121
$ this ->indexFactoryMock ,
112
- $ this ->workingStateProvider
122
+ $ this ->workingStateProvider ,
123
+ $ this ->indexerFactoryMock
113
124
);
114
125
}
115
126
@@ -356,7 +367,7 @@ protected function getIndexerData()
356
367
protected function loadIndexer ($ indexId )
357
368
{
358
369
$ this ->configMock ->expects (
359
- $ this ->once ()
370
+ $ this ->any ()
360
371
)->method (
361
372
'getIndexer '
362
373
)->with (
0 commit comments