-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep model attributes for deletedBulk method. (#477)
* fix after bulk method calls * fix number of calls * revert returns * keep model attributes
- Loading branch information
1 parent
30ad502
commit 4b767f6
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,8 +85,11 @@ public function test_it_calls_the_overriden_deleted_bulk_method(): void | |
$user->id, | ||
])->assertSuccessful(); | ||
|
||
$this->assertDatabaseMissing(User::class, ['id' => $user->id]); | ||
|
||
$this->assertDatabaseHas(User::class, [ | ||
'email' => '[email protected]', | ||
'email' => $user->email, | ||
'name' => $user->name, | ||
]); | ||
} | ||
} | ||
|
@@ -122,8 +125,11 @@ public static function savedBulk(Collection $repositories, $request) | |
|
||
public static function deletedBulk(Collection $repositories, $request) | ||
{ | ||
$first = $repositories->first(); | ||
|
||
User::factory()->create([ | ||
'email' => '[email protected]', | ||
'email' => $first['email'], | ||
'name' => $first['name'], | ||
]); | ||
} | ||
} |