Comments (4)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.
from faker.
@localheinz also noticed we could use the unique generator to exhaust the resource pool. Problem is that this will consume a lot of RAM though.
Im not a fan of just looping hundreds of times. I fact we know for sure we can not guarantee this 100% at this point however also the risk of issues is pretty low right?
from faker.
Any test that tests that asserts that a provider, given a specific seed of the generator, returns a specific value is bound to fail when the randomization engine changes - see #691, for example.
The question is, what are we going to do when the randomization engine changes? Fix all the failing tests by adjusting the expectations? Seems painful.
For example, I do not see any value in asserting that $faker->email()
returns a specific email address. I would not recommend to anyone using fakerphp/faker
to rely on $faker->email()
to return a specific value. All that should matter to them is that the returned value is semantically correct, that is, that the returned value is an email address.
On a separate note, the --repeat
option has been removed from phpunit/phpunit:10.0.0
.
from faker.
You should differentiate between what you are testing for in a library like this. Because indeed:
For example, I do not see any value in asserting that $faker->email() returns a specific email address.
Not just no value, it's downright wrong to test like that, as you are testing something that, when it fails, does not imply anything is wrong with the code. If it returns [email protected]
today and [email protected]
tomorrow the code is still working fine - it returned an email address. The only proper test for the email
function is $this->assertSame($email, filter_var($email, VALIDATE_EMAIL));
It does however make sense to test repeatable seeded determinism. email
is NOT required to always return the same email address between runs, on different computers or operating systems. It is however required to return same email address when run with the same seed in the same run in the same environment. So yes, it does make sense to get a random seed value during testing and use that to test repeated calls.
from faker.
Related Issues (20)
- Update docs to reflect different major versions HOT 2
- Remove functionality for populating ORM models and entities HOT 1
- The output of the md5(), sha1() and sha256() generators is misleading HOT 4
- The output of Base::randomFloat() is biased for certain inputs
- The Miscellaneous::boolean() generator could take a random float instead of an integer
- Warning DEPRECATED use of static pt_BR PhoneNumber HOT 1
- Opinions on Providing a Fake for CIDR/IP Prefixes HOT 3
- Faker images links are broken HOT 6
- Unable to get any other text but Latin HOT 4
- E-commerce Plugin - Feature HOT 1
- [ru_RU/PersonProvider] Double `а` in female lastName when using the `name()` function HOT 3
- Feature Request: Adjective Animal HOT 2
- Issue when try to use the create() function in the class_exists, throws an error when the documentation says the the function should not returns error just bool value. HOT 1
- `Generator::seed` in `Generator::__destruct` may break determinism HOT 1
- date/datetime functions not consistently seedable HOT 3
- `gmail.com.au` domain causes email validation to fail
- Is it maintained ? HOT 7
- Curses/profanities in dutch realText HOT 3
- Missing enum support in Doctrine HOT 5
- Dependency on doctrine/persistence on v1.23 prevents from upgrading fully to symfony 6.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faker.