wc-smooth-generator
wc-smooth-generator copied to clipboard
Improve random customers data
All Submissions:
- [x] Have you followed the Contributing guidelines?
- [x] Does your code follow the WordPress' coding standards?
- [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Changes proposed in this Pull Request:
This Pull Request contains two main enhancements:
- It will now be possible to pass the email domain name in the command line so that all the email addresses are generated with the same domain. For example, passing
--email-domain=passeddomain.com, all the customers will have their email addresses in the format[email protected]. This is vital for email testing where, for example, an external server could be used to verify the delivery of test emails (e.g. email.ghostinspector.com). If no email domain name is passed, the customers' email addresses will have their domain name randomly generated by$faker->safeEmailDomain() - With the approach in place at the moment, first and last name, username, and email address are randomly and independently generated, which ends up with the customer details being completely unrelated to one another (e.g. first name
John, last nameDoe, usernamekaren.white, email address[email protected]). This leads to a certain degree of confusion when it comes to testing certain features. With the proposed change, all the user data will be unequivocally matching (e.g. first nameJohn, last nameDoe, usernamejohn.doe, email address[email protected]or[email protected]when an email domain is passed).
How to test the changes in this Pull Request:
- Input the following command:
wp wc generate customers 10 --email-domain=passed-domain.com - Verify that the 10 newly generated customers have their username and email addresses matching their first and last name and their email addresses have the email domain name passed in the
--email-domainparameter.
Other information:
- [x] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Have you written new tests for your changes, as applicable?
- [x] Have you successfully run tests with your changes locally?
Changelog entry
Enhancement: The domain name of the email addresses of customers can now be passed in the command line. Enhancement: Usernames and email addresses of customers are now generated from the random first and last names.
FOR PR REVIEWER ONLY:
- [ ] I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.
Hi @LuigiPulcini,
Apologies not getting to this sooner. It looks like there are some conflicts now. Would you mind resolving those so that we can give this a re-review?