File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
tests/Integration/Domain/Repository/Subscription Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,29 @@ public function findBySubscriberListFindsSubscriptionOnlyWithTheGivenSubscriberL
217
217
}
218
218
}
219
219
220
+ /**
221
+ * @test
222
+ */
223
+ public function savePersistsAndFlushesModel ()
224
+ {
225
+ $ this ->getDataSet ()->addTable (static ::SUBSCRIBER_TABLE_NAME , __DIR__ . '/../Fixtures/Subscriber.csv ' );
226
+ $ this ->getDataSet ()->addTable (static ::SUBSCRIBER_LIST_TABLE_NAME , __DIR__ . '/../Fixtures/SubscriberList.csv ' );
227
+ $ this ->touchDatabaseTable (static ::TABLE_NAME );
228
+ $ this ->applyDatabaseChanges ();
229
+ $ numberOfSaveModelsBefore = count ($ this ->subject ->findAll ());
230
+
231
+ $ model = new Subscription ();
232
+ /** @var Subscriber $subscriber */
233
+ $ subscriber = $ this ->subscriberRepository ->find (1 );
234
+ $ model ->setSubscriber ($ subscriber );
235
+ /** @var SubscriberList $subscriber */
236
+ $ subscriberList = $ this ->subscriberListRepository ->find (1 );
237
+ $ model ->setSubscriberList ($ subscriberList );
238
+ $ this ->subject ->save ($ model );
239
+
240
+ static ::assertCount ($ numberOfSaveModelsBefore + 1 , $ this ->subject ->findAll ());
241
+ }
242
+
220
243
/**
221
244
* @test
222
245
*/
You can’t perform that action at this time.
0 commit comments