From 7fe97a165af1b480eed172e7f38c1ca8de7eb2ff Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 25 Oct 2023 01:11:07 +1100 Subject: [PATCH] [10.x] Update fixture hash to match testing cost (#6259) * Update fixture hash to match testing cost * Conditionally use lower cost in tests * use hash facade and memoize * remove import --------- Co-authored-by: Taylor Otwell --- database/factories/UserFactory.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index cf0be25d8..cde014af8 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; /** @@ -10,6 +11,8 @@ use Illuminate\Support\Str; */ class UserFactory extends Factory { + protected static ?string $password; + /** * Define the model's default state. * @@ -21,7 +24,7 @@ class UserFactory extends Factory 'name' => fake()->name(), 'email' => fake()->unique()->safeEmail(), 'email_verified_at' => now(), - 'password' => '$2y$12$Z/vhVO3e.UXKaG11EWgxc.EL7uej3Pi1M0Pq0orF5cbFGtyVh0V3C', // password + 'password' => static::$password ??= Hash::make('password'), 'remember_token' => Str::random(10), ]; }