2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
@@ -5,109 +5,130 @@ class UserRegistrationTestCase extends DrupalWebTestCase {
publicstaticfunctiongetInfo(){
returnarray(
'name'=>'User registration',
'description'=>'Registers a user, fails login, resets password, successfully logs in with the one time password, fails password change, changes password, logs out, successfully logs in with the new password, visits profile page.',
'description'=>'Test registration of user under different configurations.',
'group'=>'User'
);
}
/**
* Registers a user, fails login, resets password, successfully logs in with the one time password,
* changes password, logs out, successfully logs in with the new password, visits profile page.
*
* Assumes that the profile module is disabled.
*/
functiontestUserRegistration(){
// Set user registration to "Visitors can create accounts and no administrator approval is required."
variable_set('user_register',1);
functiontestRegistrationWithEmailVerification(){
// Require e-mail verification.
variable_set('user_email_verification',TRUE);
// Enable user-configurable time zones, and set the default time zone to Brussels time.
$this->assertFalse($new_user->status,t('New account is blocked until approved by an administrator.'));
}
$this->drupalPost(NULL,NULL,t('Log in'));
$this->assertText(t('You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password.'),t('This link is no longer valid.'));
$this->assertText(t('Registration successful. You are now logged in.'),t('Users are logged in after registering.'));
$this->drupalLogout();
// Allow registration by site visitors, but require administrator approval.
variable_set('user_register',2);
$edit=array();
$edit['name']=$name=$this->randomName();
$edit['mail']=$mail=$edit['name'].'@example.com';
$edit['pass[pass1]']=$pass=$this->randomName();
$edit['pass[pass2]']=$pass;
$this->drupalPost('user/register',$edit,t('Create new account'));
$this->assertText(t('Thank you for applying for an account. Your account is currently pending approval by the site administrator.'),t('Users are notified of pending approval'));
// Make sure password changes are present in database.