Improvements to Customer generator #137
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
Makes the data generated by the Customers generator more "coherent" and contextual to a locale, plus a few other enhancements to make it more useful for testing.
country
parameter to the generator, which is used to localize the Faker library that produces the random data. If a country isn't specified, falls back on randomly selecting any country that the store is configured to sell to.type
parameter to the generator, to specify if the customer should be a person or a company. Company customers do not have the first and last name fields filled in.password
so that it's easy to log in as that customer and see the store from that perspective.Fixes #131
Fixes #108
Fixes #66
How to test the changes in this Pull Request:
wp help wc generate customers
. Note the optional parameters for the command.wp wc generate customers
. You should get 10 new customers, from a wide variety of countries.wp wc generate customers 1 --country=DE
and see if the generated data matches. Try some countries that don't use a Latin alphabet, e.g.CN
orRU
.wp wc generate customers --type=company --country=FR
Changelog entry