Skip to content

Commit

Permalink
Merge pull request #212 from openforests-git/refactor/MD/XL-9628-Refa…
Browse files Browse the repository at this point in the history
…ctor-faker-use-on-Core

Refactor faker use
  • Loading branch information
Mohammad-Alavi authored Dec 1, 2024
2 parents 95710a1 + adea40f commit a995fbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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 @@ -113,8 +113,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 @@ -125,7 +125,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
2 changes: 1 addition & 1 deletion tests/Infrastructure/Doubles/BookFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class BookFactory extends CoreFactory
public function definition(): array
{
return [
'title' => $this->faker->sentence,
'title' => fake()->sentence,
'author_id' => UserFactory::new(),
];
}
Expand Down

0 comments on commit a995fbd

Please sign in to comment.