diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 6300b49a3a..3a6a6b5450 100755 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -20,12 +20,12 @@ class UserFactory extends Factory public function definition(): array { return [ - 'firstname' => fake()->unique()->firstName(), - 'lastname' => fake()->unique()->lastName(), - 'email' => fake()->unique()->safeEmail(), + 'firstname' => Str::uuid()->toString(), + 'lastname' => Str::uuid()->toString(), + 'email' => Str::uuid()->toString() . '@example.com', 'email_verified_at' => now(), - 'password' => 'password', - 'institution' => fake()->unique()->company(), + 'password' => Str::uuid()->toString(), + 'institution' => Str::uuid()->toString(), 'remember_token' => Str::random(10), 'admin' => false, ]; @@ -50,13 +50,6 @@ public function unverified(): static ]); } - public function normalUser(): static - { - return $this->state(fn (array $attributes) => [ - 'admin' => false, - ]); - } - public function adminUser(): static { return $this->state(fn (array $attributes) => [ diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index f490f676a9..58301108b9 100755 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -20,7 +20,7 @@ class DatabaseSeeder extends Seeder public function run(): void { $this->createAdminUser(); - User::factory(1000)->normalUser()->create(); + User::factory(1000)->create(); $this->createPublicProject(); $this->createTrilinosProject(); diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 30b41920af..d2ab888878 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -22365,12 +22365,6 @@ parameters: count: 1 path: config/session.php - - - rawMessage: 'Method Database\Factories\UserFactory::definition() throws checked exception OverflowException but it''s missing from the PHPDoc @throws tag.' - identifier: missingType.checkedException - count: 4 - path: database/factories/UserFactory.php - - rawMessage: 'Only booleans are allowed in &&, string given on the left side.' identifier: booleanAnd.leftNotBoolean