@@ -51,7 +51,10 @@ protected function setUp()
51
51
['getView ' ]
52
52
);
53
53
$ this ->actionFactoryMock = $ this ->createPartialMock (\Magento \Framework \Mview \ActionFactory::class, ['get ' ]);
54
- $ this ->stateMock = $ this ->createPartialMock (\Magento \Indexer \Model \Mview \View \State::class, ['getViewId ' ,
54
+ $ this ->stateMock = $ this ->createPartialMock (
55
+ \Magento \Indexer \Model \Mview \View \State::class,
56
+ [
57
+ 'getViewId ' ,
55
58
'loadByView ' ,
56
59
'getVersionId ' ,
57
60
'setVersionId ' ,
@@ -62,7 +65,8 @@ protected function setUp()
62
65
'setMode ' ,
63
66
'save ' ,
64
67
'__wakeup ' ,
65
- ]);
68
+ ]
69
+ );
66
70
$ this ->changelogMock = $ this ->createPartialMock (
67
71
\Magento \Framework \Mview \View \Changelog::class,
68
72
['getViewId ' , 'setViewId ' , 'create ' , 'drop ' , 'getVersion ' , 'getList ' , 'clear ' ]
@@ -182,11 +186,11 @@ public function testSubscribeWithException()
182
186
183
187
$ this ->changelogMock ->expects ($ this ->once ())
184
188
->method ('create ' )
185
- ->will ( $ this -> returnCallback (
189
+ ->willReturnCallback (
186
190
function () {
187
191
throw new \Exception ();
188
192
}
189
- )) ;
193
+ );
190
194
191
195
$ this ->loadView ();
192
196
$ this ->model ->subscribe ();
@@ -245,11 +249,11 @@ public function testUnsubscribeWithException()
245
249
$ subscriptionMock = $ this ->createPartialMock (\Magento \Framework \Mview \View \Subscription::class, ['remove ' ]);
246
250
$ subscriptionMock ->expects ($ this ->exactly (1 ))
247
251
->method ('remove ' )
248
- ->will ( $ this -> returnCallback (
252
+ ->willReturnCallback (
249
253
function () {
250
254
throw new \Exception ();
251
255
}
252
- )) ;
256
+ );
253
257
$ this ->subscriptionFactoryMock ->expects ($ this ->exactly (1 ))
254
258
->method ('create ' )
255
259
->will ($ this ->returnValue ($ subscriptionMock ));
@@ -273,6 +277,9 @@ public function testUpdate()
273
277
$ this ->stateMock ->expects ($ this ->once ())
274
278
->method ('setVersionId ' )
275
279
->will ($ this ->returnSelf ());
280
+ $ this ->stateMock ->expects ($ this ->atLeastOnce ())
281
+ ->method ('getMode ' )
282
+ ->willReturn (\Magento \Framework \Mview \View \StateInterface::MODE_ENABLED );
276
283
$ this ->stateMock ->expects ($ this ->exactly (2 ))
277
284
->method ('getStatus ' )
278
285
->will ($ this ->returnValue (\Magento \Framework \Mview \View \StateInterface::STATUS_IDLE ));
@@ -335,6 +342,9 @@ public function testUpdateWithException()
335
342
->will ($ this ->returnValue ($ lastVersionId ));
336
343
$ this ->stateMock ->expects ($ this ->never ())
337
344
->method ('setVersionId ' );
345
+ $ this ->stateMock ->expects ($ this ->atLeastOnce ())
346
+ ->method ('getMode ' )
347
+ ->willReturn (\Magento \Framework \Mview \View \StateInterface::MODE_ENABLED );
338
348
$ this ->stateMock ->expects ($ this ->exactly (2 ))
339
349
->method ('getStatus ' )
340
350
->will ($ this ->returnValue (\Magento \Framework \Mview \View \StateInterface::STATUS_IDLE ));
0 commit comments