-
-
Notifications
You must be signed in to change notification settings - Fork 437
Open
Description
make:security:form-login, when asked to generate unit tests, generate the following line :
$user = (new User())->setEmail('[email protected]');It works if the user entity has been generated with the default identifier property ("email"). But if you use another property when using make:form-login (in my case : username), it won't be consistent. And either generates an error, because there is no "email" property. Or, if you added one, makes the test fail, or generates an error, as we try to create a user with an email but without username...
I suggest one (or more) the following :
- add a comment above this line, saying "Please adjust the following line if your User Entity use another identifier property than Email"
- outputs the same as a warning on the command line
- try to detect which property is used as userIdentifier
- use Reflection to get the body of getUserIdentifier
- use Reflection to fill in every property of an User object with random, different, values, and check which one is returned by getUserIdentifier
- ask on the command line the name of the property used as userIdentifier
- require developer to write a "setUserIdentifier" method in his User class, or allow it and detect its presence with method_exists
Metadata
Metadata
Assignees
Labels
No labels