Skip to content

Commit

Permalink
refactor deprecated $this->faker to laravel fake() method
Browse files Browse the repository at this point in the history
  • Loading branch information
mderis committed Oct 28, 2024
1 parent f1d6993 commit 28a74a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Traits/TestTraits/PhpUnit/TestAuthHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ private function factoryCreateUser(array|null $userDetails = null): UserModel
private function prepareUserDetails(array|null $userDetails = null): array
{
$defaultUserDetails = [
'name' => $this->faker->name,
'email' => $this->faker->email,
'name' => fake()->name,
'email' => fake()->email,
'password' => 'testing-password',
];

Expand All @@ -121,7 +121,7 @@ private function prepareUserDetails(array|null $userDetails = null): array
private function prepareUserPassword(array|null $userDetails): array|null
{
// get password from the user details or generate one
$password = $userDetails['password'] ?? $this->faker->password;
$password = $userDetails['password'] ?? fake()->password;

// hash the password and set it back at the user details
$userDetails['password'] = Hash::make($password);
Expand Down

0 comments on commit 28a74a3

Please sign in to comment.