Skip to content

Commit e92c2cb

Browse files
oliverkleeSam Tuke
authored andcommitted
[CLEANUP] Use Repository.remove when testing cascading removal (#282)
1 parent a70b743 commit e92c2cb

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

tests/Integration/Domain/Repository/Messaging/SubscriberListRepositoryTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ public function removeAlsoRemovesAssociatedSubscriptions()
283283
$numberOfAssociatedSubscriptions = count($model->getSubscriptions());
284284
static::assertGreaterThan(0, $numberOfAssociatedSubscriptions);
285285

286-
$this->entityManager->remove($model);
287-
$this->entityManager->flush();
286+
$this->subject->remove($model);
288287

289288
$newNumberOfSubscriptions = count($this->subscriptionRepository->findAll());
290289
$numberOfRemovedSubscriptions = $initialNumberOfSubscriptions - $newNumberOfSubscriptions;

tests/Integration/Domain/Repository/Subscription/SubscriberRepositoryTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,7 @@ public function removeAlsoRemovesAssociatedSubscriptions()
288288
$numberOfAssociatedSubscriptions = count($model->getSubscriptions());
289289
static::assertGreaterThan(0, $numberOfAssociatedSubscriptions);
290290

291-
$this->entityManager->remove($model);
292-
$this->entityManager->flush();
291+
$this->subject->remove($model);
293292

294293
$newNumberOfSubscriptions = count($this->subscriptionRepository->findAll());
295294
$numberOfRemovedSubscriptions = $initialNumberOfSubscriptions - $newNumberOfSubscriptions;

0 commit comments

Comments
 (0)