Commit graph

3 commits

Author SHA1 Message Date
Thalia
14bb09fe7f UserFactory: Document that newFromName expects a validation constant
When no validation is wanted, a UserNameUtils constant must be passed
to UserFactory::newFromName, whereas User::newFromName accepts false.

Also pass a constant as the default parameter, rather than the string
value of that constant.

Bug: T255611
Change-Id: Iffd405cb8b38debe9d0a7106a76c430956351583
2020-06-17 12:51:13 +01:00
DannyS712
2d7d99f036 Move User::newFromIdentity logic to UserFactory
Simplest static constructor for Users, no dependencies on anything else

Bug: T253432
Change-Id: Ibe422de4f1753334f2737bc39e077b1e4173ad45
2020-06-12 18:24:49 +00:00
DannyS712
61a3a8f734 UserFactory v.1 - wrapper for User::newFrom* static methods
Makes it possible to mock static User methods in tests;
actually introducing dependency injection to the User class is left for
the future.

New class has 100% code coverage

Bug: T253432
Change-Id: I0b93da09124d95beafd84e932b214909ce920230
2020-06-10 20:38:26 -07:00