See parent task and T110431#1604967.
Items needing updating:
- Uses the AddNewAccount hook, which has been deprecated in favor of the LocalUserCreated hook since 1.26wmf4.
- Uses the UserCreateForm hook, which is deprecated under AuthManager and may not continue to work in the way it did before.
What you'd probably want to do in this case is make an AuthenticationRequest to capture your 'testwikiproject' and 'testwikicode' fields (replaces the UserCreateForm hook), and a SecondaryAuthenticationProvider that requires that AuthenticationRequest for AuthManager::CREATE actions and makes use of it in beginSecondaryAccountCreation() (replaces the AddNewAccount hook).