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
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