From cf484c76fc2f0a97613f5638e47a1e1f10247956 Mon Sep 17 00:00:00 2001 From: roble Date: Sun, 25 Oct 2026 15:15:44 +0000 Subject: [PATCH] fix: update UserFactory to generate non-unique email addresses for testing --- Taskfile.yml | 3 +-- database/factories/UserFactory.php | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index abf93063..fe6e8105 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -110,12 +110,11 @@ tasks: - '{{.APP}} php artisan modules:seed' db:reset:demo: - desc: Reset database and load sample content with an admin account + desc: Reset database and load sample content (the auth module's demo includes an admin) prompt: This will erase ALL data. Are you sure? cmds: - '{{.APP}} php artisan migrate:fresh --seed' - '{{.APP}} php artisan modules:seed --demo' - - '{{.APP}} php artisan auth:make-admin chef@saucebase.dev' db:seed:demo: desc: Seed every module with sample content diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index a3be0f25..a96883bd 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -28,7 +28,8 @@ public function definition(): array { return [ 'name' => fake()->name(), - 'email' => fake()->unique()->safeEmail(), + // Not unique(): it only remembers one request, and E2E tests create each user in its own. + 'email' => fake()->userName().'.'.Str::lower(Str::random(8)).'@example.com', 'email_verified_at' => now(), 'password' => static::$password ??= Hash::make('password'), 'remember_token' => Str::random(10),