@@ -207,7 +207,7 @@ public function testCreate()
207
207
->method ('getColumnName ' )
208
208
->willReturn ('entity_id ' );
209
209
210
- $ this ->viewMock ->expects ($ this ->exactly ( 3 ))
210
+ $ this ->viewMock ->expects ($ this ->atLeastOnce ( ))
211
211
->method ('getChangelog ' )
212
212
->willReturn ($ changelogMock );
213
213
@@ -251,17 +251,15 @@ public function testCreate()
251
251
'otherTableName ' => ['name ' => 'otherTableName ' , 'column ' => 'columnName ' ]
252
252
]
253
253
);
254
- $ otherViewMock ->expects ($ this ->exactly ( 3 ))
254
+ $ otherViewMock ->expects ($ this ->atLeastOnce ( ))
255
255
->method ('getChangelog ' )
256
256
->willReturn ($ otherChangelogMock );
257
257
258
258
$ this ->viewMock ->expects ($ this ->any ())
259
259
->method ('getId ' )
260
260
->willReturn ('this_id ' );
261
- $ this ->viewMock ->expects ($ this ->never ())
262
- ->method ('getSubscriptions ' );
263
261
264
- $ this ->viewCollectionMock ->expects ($ this ->exactly ( 1 ))
262
+ $ this ->viewCollectionMock ->expects ($ this ->once ( ))
265
263
->method ('getViewsByStateMode ' )
266
264
->with (StateInterface::MODE_ENABLED )
267
265
->willReturn ([$ this ->viewMock , $ otherViewMock ]);
@@ -274,8 +272,6 @@ public function testCreate()
274
272
->method ('createTrigger ' )
275
273
->with ($ triggerMock );
276
274
277
- $ this ->tableName = 'thisTableName ' ;
278
-
279
275
$ this ->viewMock ->expects ($ this ->exactly (3 ))
280
276
->method ('getSubscriptions ' )
281
277
->willReturn (
@@ -293,7 +289,7 @@ public function testRemove()
293
289
$ triggerMock = $ this ->createMock (Trigger::class);
294
290
$ triggerMock ->expects ($ this ->exactly (3 ))
295
291
->method ('setName ' )->willReturnSelf ();
296
- $ triggerMock ->expects ($ this ->exactly ( 3 ))
292
+ $ triggerMock ->expects ($ this ->any ( ))
297
293
->method ('getName ' )
298
294
->willReturn ('triggerName ' );
299
295
$ triggerMock ->expects ($ this ->exactly (3 ))
@@ -320,7 +316,7 @@ public function testRemove()
320
316
true ,
321
317
[]
322
318
);
323
- $ otherChangelogMock ->expects ($ this ->exactly ( 3 ))
319
+ $ otherChangelogMock ->expects ($ this ->any ( ))
324
320
->method ('getName ' )
325
321
->willReturn ('other_test_view_cl ' );
326
322
$ otherChangelogMock ->expects ($ this ->exactly (3 ))
@@ -336,17 +332,17 @@ public function testRemove()
336
332
true ,
337
333
[]
338
334
);
339
-
340
- $ otherViewMock ->expects ($ this ->exactly (1 ))
335
+ $ otherViewMock ->expects ($ this ->atLeastOnce ())
341
336
->method ('getId ' )
342
337
->willReturn ('other_id ' );
343
-
344
- $ otherViewMock ->expects ($ this ->exactly (3 ))
338
+ $ otherViewMock ->expects ($ this ->atLeastOnce ())
345
339
->method ('getChangelog ' )
346
340
->willReturn ($ otherChangelogMock );
347
341
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 ())
350
346
->method ('getSubscriptions ' )
351
347
->willReturn (
352
348
[
@@ -355,10 +351,6 @@ public function testRemove()
355
351
]
356
352
);
357
353
358
- $ this ->viewMock ->expects ($ this ->exactly (3 ))
359
- ->method ('getId ' )
360
- ->willReturn ('this_id ' );
361
-
362
354
$ this ->viewCollectionMock ->expects ($ this ->exactly (1 ))
363
355
->method ('getViewsByStateMode ' )
364
356
->with (StateInterface::MODE_ENABLED )
@@ -443,7 +435,7 @@ public function testBuildStatementIgnoredColumnSubscriptionLevel(): void
443
435
'cataloginventory_stock_item ' => ['name ' => 'otherTableName ' , 'column ' => 'columnName ' ]
444
436
]
445
437
);
446
- $ this ->viewMock ->expects ($ this ->once ())
438
+ $ this ->viewMock ->expects ($ this ->atLeastOnce ())
447
439
->method ('getChangeLog ' )
448
440
->willReturn ($ otherChangelogMock );
449
441
0 commit comments