@@ -207,7 +207,7 @@ public function testCreate()
207207 ->method ('getColumnName ' )
208208 ->willReturn ('entity_id ' );
209209
210- $ this ->viewMock ->expects ($ this ->exactly ( 3 ))
210+ $ this ->viewMock ->expects ($ this ->atLeastOnce ( ))
211211 ->method ('getChangelog ' )
212212 ->willReturn ($ changelogMock );
213213
@@ -251,17 +251,15 @@ public function testCreate()
251251 'otherTableName ' => ['name ' => 'otherTableName ' , 'column ' => 'columnName ' ]
252252 ]
253253 );
254- $ otherViewMock ->expects ($ this ->exactly ( 3 ))
254+ $ otherViewMock ->expects ($ this ->atLeastOnce ( ))
255255 ->method ('getChangelog ' )
256256 ->willReturn ($ otherChangelogMock );
257257
258258 $ this ->viewMock ->expects ($ this ->any ())
259259 ->method ('getId ' )
260260 ->willReturn ('this_id ' );
261- $ this ->viewMock ->expects ($ this ->never ())
262- ->method ('getSubscriptions ' );
263261
264- $ this ->viewCollectionMock ->expects ($ this ->exactly ( 1 ))
262+ $ this ->viewCollectionMock ->expects ($ this ->once ( ))
265263 ->method ('getViewsByStateMode ' )
266264 ->with (StateInterface::MODE_ENABLED )
267265 ->willReturn ([$ this ->viewMock , $ otherViewMock ]);
@@ -274,8 +272,6 @@ public function testCreate()
274272 ->method ('createTrigger ' )
275273 ->with ($ triggerMock );
276274
277- $ this ->tableName = 'thisTableName ' ;
278-
279275 $ this ->viewMock ->expects ($ this ->exactly (3 ))
280276 ->method ('getSubscriptions ' )
281277 ->willReturn (
@@ -293,7 +289,7 @@ public function testRemove()
293289 $ triggerMock = $ this ->createMock (Trigger::class);
294290 $ triggerMock ->expects ($ this ->exactly (3 ))
295291 ->method ('setName ' )->willReturnSelf ();
296- $ triggerMock ->expects ($ this ->exactly ( 3 ))
292+ $ triggerMock ->expects ($ this ->any ( ))
297293 ->method ('getName ' )
298294 ->willReturn ('triggerName ' );
299295 $ triggerMock ->expects ($ this ->exactly (3 ))
@@ -320,7 +316,7 @@ public function testRemove()
320316 true ,
321317 []
322318 );
323- $ otherChangelogMock ->expects ($ this ->exactly ( 3 ))
319+ $ otherChangelogMock ->expects ($ this ->any ( ))
324320 ->method ('getName ' )
325321 ->willReturn ('other_test_view_cl ' );
326322 $ otherChangelogMock ->expects ($ this ->exactly (3 ))
@@ -336,17 +332,17 @@ public function testRemove()
336332 true ,
337333 []
338334 );
339-
340- $ otherViewMock ->expects ($ this ->exactly (1 ))
335+ $ otherViewMock ->expects ($ this ->atLeastOnce ())
341336 ->method ('getId ' )
342337 ->willReturn ('other_id ' );
343-
344- $ otherViewMock ->expects ($ this ->exactly (3 ))
338+ $ otherViewMock ->expects ($ this ->atLeastOnce ())
345339 ->method ('getChangelog ' )
346340 ->willReturn ($ otherChangelogMock );
347341
348- $ this ->viewMock ->expects ($ this ->any ())
349- $ otherViewMock ->expects ($ this ->any ())
342+ $ this ->viewMock ->expects ($ this ->atLeastOnce ())
343+ ->method ('getId ' )
344+ ->willReturn ('this_id ' );
345+ $ otherViewMock ->expects ($ this ->atLeastOnce ())
350346 ->method ('getSubscriptions ' )
351347 ->willReturn (
352348 [
@@ -355,10 +351,6 @@ public function testRemove()
355351 ]
356352 );
357353
358- $ this ->viewMock ->expects ($ this ->exactly (3 ))
359- ->method ('getId ' )
360- ->willReturn ('this_id ' );
361-
362354 $ this ->viewCollectionMock ->expects ($ this ->exactly (1 ))
363355 ->method ('getViewsByStateMode ' )
364356 ->with (StateInterface::MODE_ENABLED )
@@ -443,7 +435,7 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void
443435 'cataloginventory_stock_item ' => ['name ' => 'otherTableName ' , 'column ' => 'columnName ' ]
444436 ]
445437 );
446- $ this ->viewMock ->expects ($ this ->once ())
438+ $ this ->viewMock ->expects ($ this ->atLeastOnce ())
447439 ->method ('getChangeLog ' )
448440 ->willReturn ($ otherChangelogMock );
449441
0 commit comments