From c371d49b142b3a97d85d89bb827e224c967a7a4c Mon Sep 17 00:00:00 2001 From: salvobee Date: Mon, 21 Jun 2021 15:40:47 +0200 Subject: [PATCH] Fix EmailVerificationTest to pass using Uuids 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. --- stubs/default/tests/Feature/EmailVerificationTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/default/tests/Feature/EmailVerificationTest.php b/stubs/default/tests/Feature/EmailVerificationTest.php index 61b577517..30c416733 100644 --- a/stubs/default/tests/Feature/EmailVerificationTest.php +++ b/stubs/default/tests/Feature/EmailVerificationTest.php @@ -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',