@@ -44,7 +44,7 @@ class SubscriptionTest extends TestCase
4444 protected $ viewMock ;
4545
4646 /** @var string */
47- private $ tableName ;
47+ private $ tableName = ' thisTableName ' ;
4848
4949 protected function setUp (): void
5050 {
@@ -210,9 +210,14 @@ public function testCreate()
210210 $ otherViewMock ->expects ($ this ->exactly (1 ))
211211 ->method ('getId ' )
212212 ->willReturn ('other_id ' );
213- $ otherViewMock ->expects ($ this ->exactly (1 ))
213+ $ otherViewMock ->expects ($ this ->exactly (4 ))
214214 ->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+ );
216221 $ otherViewMock ->expects ($ this ->exactly (3 ))
217222 ->method ('getChangelog ' )
218223 ->willReturn ($ otherChangelogMock );
@@ -234,6 +239,17 @@ public function testCreate()
234239 ->method ('createTrigger ' )
235240 ->with ($ triggerMock );
236241
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+
237253 $ this ->model ->create ();
238254 }
239255
@@ -285,6 +301,7 @@ public function testRemove()
285301 true ,
286302 []
287303 );
304+
288305 $ otherViewMock ->expects ($ this ->exactly (1 ))
289306 ->method ('getId ' )
290307 ->willReturn ('other_id ' );
@@ -293,6 +310,15 @@ public function testRemove()
293310 ->method ('getChangelog ' )
294311 ->willReturn ($ otherChangelogMock );
295312
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+
296322 $ this ->viewMock ->expects ($ this ->exactly (3 ))
297323 ->method ('getId ' )
298324 ->willReturn ('this_id ' );
0 commit comments