thephpleague / factory-muffin

Enables the rapid creation of objects for testing
https://factory-muffin.thephpleague.com/
MIT License
532 stars 72 forks source link

Add warning to docs that you can't use your own Faker instance #467

Closed igorsantos07 closed 4 years ago

igorsantos07 commented 4 years ago

My tests already had a custom Faker installation, but it's not obvious from the docs you must use the facade, otherwise, you'll get duplicated entries.

And no need to suggest "we accept PRs", I'm posting this as an up for grabs. I may come back if I get some free time, as this lib seems useful and is definitely needing some love, but I definitely can't guarantee.

Speaking of PRs btw, #426 is definitely lacking.

GrahamCampbell commented 4 years ago

but it's not obvious from the docs you must use the facade, otherwise, you'll get duplicated entries.

That's not true. You just need to persist your instance between tests...

igorsantos07 commented 4 years ago

So this is, at the very least, a Codeception bug. I'll check what they do with your library, then, as I guess you're not interested in debugging.

Nonetheless, if someone noticed that, why not mentioning this in docs instead of straight out closing the issue?

Not sure if I'm the doc freak or you're the careless undocumenter.

On Mon, Jun 22, 2020, 06:23 Graham Campbell notifications@github.com wrote:

but it's not obvious from the docs you must use the facade, otherwise, you'll get duplicated entries.

That's not true. You just need to persist your instance between tests...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thephpleague/factory-muffin/issues/467#issuecomment-647396428, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEB6S5SQQ6ZKNZ5U7W3YC3RX4PHPANCNFSM4OEGL4FQ .

GrahamCampbell commented 4 years ago

It is not a bug in codeception. It's a bug in your test. If you make a new instance each time, of course it doesn't know about what has been generated in the past...