We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
After recent changes to the WithFaker trait on #30992 trying to use a different locale when testing no longer works.
Also related to #30345
New up a laravel, attempt to create a locale faker instance:
abstract class TestCase extends BaseTestCase { use CreatesApplication, WithFaker; protected function setUpFaker() { $this->faker = $this->makeFaker('en_GB'); // attempt to output locale number, always from Faker\Provider\en_US\PhoneNumber dd($this->faker->phoneNumber); } }
The text was updated successfully, but these errors were encountered:
This happens because
framework/src/Illuminate/Foundation/Testing/WithFaker.php
Line 49 in 32d1ed5
make()
framework/src/Illuminate/Database/DatabaseServiceProvider.php
Lines 77 to 79 in 32d1ed5
Sorry, something went wrong.
@AegirLeet yeah, personally I would be leaning to revert #30992 as the use case was quite specific and could be handled in an overridden setUpFaker.
setUpFaker
Successfully merging a pull request may close this issue.
Description:
After recent changes to the WithFaker trait on #30992 trying to use a different locale when testing no longer works.
Also related to #30345
Steps To Reproduce:
New up a laravel, attempt to create a locale faker instance:
The text was updated successfully, but these errors were encountered: