Open
Conversation
Luc45
previously approved these changes
Jul 1, 2022
Member
Luc45
left a comment
There was a problem hiding this comment.
Works great! Thanks for the contribution!
wp wc generate customers 10
wp wc generate customers 10 --email-domain=foo-bar.com
I do expect some merge conflicts with #80, though.
I'll forward this internally to see if we can get it merged soon.
JPry
reviewed
Jul 1, 2022
Comment on lines
+124
to
+128
| $domain = ''; | ||
|
|
||
| if ( ! empty( $assoc_args['email-domain'] ) ) { | ||
| $domain = $assoc_args['email-domain']; | ||
| } |
There was a problem hiding this comment.
This can be consolidated to one line:
Suggested change
| $domain = ''; | |
| if ( ! empty( $assoc_args['email-domain'] ) ) { | |
| $domain = $assoc_args['email-domain']; | |
| } | |
| $domain = $assoc_args['email-domain'] ?? ''; |
| do { | ||
| $username = self::$faker->userName(); | ||
| } while ( username_exists( $username ) ); | ||
| $safeEmailDomain = $emailDomain ? $emailDomain : self::$faker->safeEmailDomain(); |
There was a problem hiding this comment.
The second instance of the variable is redundant.
Suggested change
| $safeEmailDomain = $emailDomain ? $emailDomain : self::$faker->safeEmailDomain(); | |
| $safeEmailDomain = $emailDomain ?: self::$faker->safeEmailDomain(); |
File conflicts from out of date files
Contributor
|
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


All Submissions:
Changes proposed in this Pull Request:
This Pull Request contains two main enhancements:
--email-domain=passeddomain.com, all the customers will have their email addresses in the formatfirst.last@passeddomain.com. 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()John, last nameDoe, usernamekaren.white, email addressjustin.brown@example.com). 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 addressjohn.doe@example.comorjohn.doe@passed-domain.comwhen an email domain is passed).How to test the changes in this Pull Request:
wp wc generate customers 10 --email-domain=passed-domain.com--email-domainparameter.Other information:
Changelog entry
FOR PR REVIEWER ONLY: