@@ -44,7 +44,7 @@ class SubscriptionTest extends TestCase
44
44
protected $ viewMock ;
45
45
46
46
/** @var string */
47
- private $ tableName ;
47
+ private $ tableName = ' thisTableName ' ;
48
48
49
49
protected function setUp (): void
50
50
{
@@ -210,9 +210,14 @@ public function testCreate()
210
210
$ otherViewMock ->expects ($ this ->exactly (1 ))
211
211
->method ('getId ' )
212
212
->willReturn ('other_id ' );
213
- $ otherViewMock ->expects ($ this ->exactly (1 ))
213
+ $ otherViewMock ->expects ($ this ->exactly (4 ))
214
214
->method ('getSubscriptions ' )
215
- ->willReturn ([['name ' => $ this ->tableName ], ['name ' => 'otherTableName ' ]]);
215
+ ->willReturn (
216
+ [
217
+ $ this ->tableName => ['name ' => $ this ->tableName , 'column ' => 'columnName ' ],
218
+ 'otherTableName ' => ['name ' => 'otherTableName ' , 'column ' => 'columnName ' ]
219
+ ]
220
+ );
216
221
$ otherViewMock ->expects ($ this ->exactly (3 ))
217
222
->method ('getChangelog ' )
218
223
->willReturn ($ otherChangelogMock );
@@ -234,6 +239,17 @@ public function testCreate()
234
239
->method ('createTrigger ' )
235
240
->with ($ triggerMock );
236
241
242
+ $ this ->tableName = 'thisTableName ' ;
243
+
244
+ $ this ->viewMock ->expects ($ this ->exactly (3 ))
245
+ ->method ('getSubscriptions ' )
246
+ ->willReturn (
247
+ [
248
+ $ this ->tableName => ['name ' => $ this ->tableName , 'column ' => 'columnName ' ],
249
+ 'otherTableName ' => ['name ' => 'otherTableName ' , 'column ' => 'columnName ' ]
250
+ ]
251
+ );
252
+
237
253
$ this ->model ->create ();
238
254
}
239
255
@@ -285,6 +301,7 @@ public function testRemove()
285
301
true ,
286
302
[]
287
303
);
304
+
288
305
$ otherViewMock ->expects ($ this ->exactly (1 ))
289
306
->method ('getId ' )
290
307
->willReturn ('other_id ' );
@@ -293,6 +310,15 @@ public function testRemove()
293
310
->method ('getChangelog ' )
294
311
->willReturn ($ otherChangelogMock );
295
312
313
+ $ otherViewMock ->expects ($ this ->any ())
314
+ ->method ('getSubscriptions ' )
315
+ ->willReturn (
316
+ [
317
+ $ this ->tableName => ['name ' => $ this ->tableName , 'column ' => 'columnName ' ],
318
+ 'otherTableName ' => ['name ' => 'otherTableName ' , 'column ' => 'columnName ' ]
319
+ ]
320
+ );
321
+
296
322
$ this ->viewMock ->expects ($ this ->exactly (3 ))
297
323
->method ('getId ' )
298
324
->willReturn ('this_id ' );
0 commit comments