Skip to content

Commit

Permalink
Fix EmailVerificationTest to pass using Uuids (#85)
Browse files Browse the repository at this point in the history
Most of the solutions to use UUIDs as primary key for models relies on Eloquent events.
The Breeze email verification's test fakes the Event bus before a fake user is created, so if you're going to use an event based solution for generating uuid it will fail while trying to create the user (integrity constraint on SQL).
The solution should be quite easy: creating the user before start faking the event bus.
  • Loading branch information
salvobee authored Jun 21, 2021
1 parent 2787ef9 commit bd13b66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stubs/default/tests/Feature/EmailVerificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public function test_email_verification_screen_can_be_rendered()

public function test_email_can_be_verified()
{
Event::fake();

$user = User::factory()->create([
'email_verified_at' => null,
]);

Event::fake();

$verificationUrl = URL::temporarySignedRoute(
'verification.verify',
Expand Down

0 comments on commit bd13b66

Please sign in to comment.