Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor faker use #212

Open
wants to merge 2 commits into
base: 8.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 prepareUserDetails(array|null $userDetails = null): array
{
$defaultUserDetails = [
'name' => $this->faker->name,
'email' => $this->faker->email,
'name' => fake()->name,
'email' => fake()->email,

Check warning on line 113 in src/Traits/TestTraits/PhpUnit/TestAuthHelperTrait.php

View check run for this annotation

Codecov / codecov/patch

src/Traits/TestTraits/PhpUnit/TestAuthHelperTrait.php#L112-L113

Added lines #L112 - L113 were not covered by tests
'password' => 'testing-password',
];

Expand All @@ -121,7 +121,7 @@
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;

Check warning on line 124 in src/Traits/TestTraits/PhpUnit/TestAuthHelperTrait.php

View check run for this annotation

Codecov / codecov/patch

src/Traits/TestTraits/PhpUnit/TestAuthHelperTrait.php#L124

Added line #L124 was not covered by tests

// 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
Loading