diff --git a/tests/Unit/InvitationTest.php b/tests/Unit/InvitationTest.php index 2b185116721a..1aced3f262f4 100644 --- a/tests/Unit/InvitationTest.php +++ b/tests/Unit/InvitationTest.php @@ -50,11 +50,8 @@ class InvitationTest extends TestCase $this->assertEquals(1, count($invites)); - $this->invoice->invitations()->each(function ($invite){ - - if(!$invite->contact->is_primary) - $invite->forceDelete(); - }); + /** @phpstan-ignore-next-line **/ + $this->invoice->invitations = $invites; $this->invoice->line_items = []; @@ -84,9 +81,12 @@ class InvitationTest extends TestCase $new_invite->key = $this->createDbHash(config('database.default')); $invitations = $this->invoice->invitations()->get(); + $invitations->push($new_invite); + /** @phpstan-ignore-next-line **/ $this->invoice->invitations = $invitations->toArray(); + $this->invoice->line_items = []; $response = $this->withHeaders([