@@ -184,7 +184,6 @@ public function findBySubscriberFindsSubscriptionOnlyWithTheGivenSubscriber()
184
184
{
185
185
$ this ->getDataSet ()->addTable (static ::SUBSCRIBER_TABLE_NAME , __DIR__ . '/../Fixtures/Subscriber.csv ' );
186
186
$ this ->getDataSet ()->addTable (static ::TABLE_NAME , __DIR__ . '/../Fixtures/Subscription.csv ' );
187
- $ this ->touchDatabaseTable (static ::TABLE_NAME );
188
187
$ this ->applyDatabaseChanges ();
189
188
190
189
/** @var Subscriber $subscriber */
@@ -205,7 +204,6 @@ public function findBySubscriberListFindsSubscriptionOnlyWithTheGivenSubscriberL
205
204
{
206
205
$ this ->getDataSet ()->addTable (static ::SUBSCRIBER_TABLE_NAME , __DIR__ . '/../Fixtures/Subscriber.csv ' );
207
206
$ this ->getDataSet ()->addTable (static ::TABLE_NAME , __DIR__ . '/../Fixtures/Subscription.csv ' );
208
- $ this ->touchDatabaseTable (static ::TABLE_NAME );
209
207
$ this ->applyDatabaseChanges ();
210
208
211
209
/** @var SubscriberList $subscriberList */
@@ -218,4 +216,23 @@ public function findBySubscriberListFindsSubscriptionOnlyWithTheGivenSubscriberL
218
216
static ::assertSame ($ subscriberList , $ subscription ->getSubscriberList ());
219
217
}
220
218
}
219
+
220
+ /**
221
+ * @test
222
+ */
223
+ public function removeRemovesModel ()
224
+ {
225
+ $ this ->getDataSet ()->addTable (static ::TABLE_NAME , __DIR__ . '/../Fixtures/Subscription.csv ' );
226
+ $ this ->applyDatabaseChanges ();
227
+
228
+ /** @var Subscription[] $allModels */
229
+ $ allModels = $ this ->subject ->findAll ();
230
+ $ numberOfModelsBeforeRemove = count ($ allModels );
231
+ $ firstModel = $ allModels [0 ];
232
+
233
+ $ this ->subject ->remove ($ firstModel );
234
+
235
+ $ numberOfModelsAfterRemove = count ($ this ->subject ->findAll ());
236
+ static ::assertSame (1 , $ numberOfModelsBeforeRemove - $ numberOfModelsAfterRemove );
237
+ }
221
238
}
0 commit comments