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

Add a way to define a seed for faker #4

Open
pakacuda opened this issue May 6, 2020 · 1 comment
Open

Add a way to define a seed for faker #4

pakacuda opened this issue May 6, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@pakacuda
Copy link
Collaborator

pakacuda commented May 6, 2020

It could be done dynamically on a 'per test' basis in the setUp method of a phpunit test case
Or maybe through a config file. Using this method would seed the whole test suite.
Will have to see which option is the best suited. I would go for the first one alogside a 'default' seed

@pakacuda pakacuda added the enhancement New feature or request label May 7, 2020
@pabloelcolombiano
Copy link
Collaborator

To add a faker seed at the factory level with a setFakerSeed native method?
You would have:
$article = ArticleFactory::make()->setFakerSeed(123)
I think it is then the role of the developer to define a $SeededArticleFactory in setUp() to be reused in each test.
That is the way I would solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants