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
drupal_set_message(t('Please complete the registration by filling out the form below. If you already have an account, you can <a href="@login">log in</a> now and add your OpenID under "My account".',array('@login'=>url('user/login'))),'warning');
drupal_set_message(t('Account registration using the information provided by your OpenID provider failed due to the reasons listed below. Please complete the registration by filling out the form below. If you already have an account, you can <a href="@login">log in</a> now and add your OpenID under "My account".',array('@login'=>url('user/login'))),'warning');
// Append form validation errors below the above warning.
$messages=drupal_get_messages('error');
foreach($messages['error']as$message){
drupal_set_message($message,'error');
}
}
}
if(!$success){
// We were unable to register a valid new user, redirect to standard
// user/register and prefill with the values we received.
drupal_set_message(t('OpenID registration failed for the reasons listed. You may register now, or if you already have an account you can <a href="@login">log in</a> now and add your OpenID under "My Account"',array('@login'=>url('user/login'))),'error');
$this->assertTitle(t('OpenID redirect'),t('OpenID redirect page was displayed.'));
// Submit form to the OpenID Provider Endpoint.
$this->drupalPost(NULL,array(),t('Send'));
$this->assertRaw(t('Account registration using the information provided by your OpenID provider failed due to the reasons listed below. Please complete the registration by filling out the form below. If you already have an account, you can <a href="@login">log in</a> now and add your OpenID under "My account".',array('@login'=>url('user/login'))),t('User was asked to complete the registration process manually.'));
$this->assertRaw(t('The name %name is already taken.',array('%name'=>$this->web_user->name)),t('Form validation error for username was displayed.'));
$this->assertRaw(t('The e-mail address %mail is not valid.',array('%mail'=>'mail@invalid#')),t('Form validation error for e-mail address was displayed.'));
// The OpenID module responds with an HTML form that is to be submitted
// to the OpenID Provider Endpoint. This is usually done automatically
// using JavaScript, but the SimpleTest browser does not support JavaScript,
// so the form is submitted manually instead.
$this->assertRaw('<script type="text/javascript">document.getElementById("openid-redirect-form").submit();</script>',t('JavaScript form submission found.'));
// Check we are on the OpenID redirect form.
$this->assertTitle(t('OpenID redirect'),t('OpenID redirect page was displayed.'));
// Submit form to the OpenID Provider Endpoint.
$this->drupalPost(NULL,array(),t('Send'));
$this->assertText('johndoe',t('User was logged in.'));
$user=user_load_by_name('johndoe');
$this->assertTrue($user,t('User was found.'));
$this->assertEqual($user->mail,'johndoe@example.com',t('User was registered with right email address.'));
$this->assertRaw(t('Please complete the registration by filling out the form below. If you already have an account, you can <a href="@login">log in</a> now and add your OpenID under "My account".',array('@login'=>url('user/login'))),t('User was asked to complete the registration process manually.'));
$this->assertNoRaw(t('You must enter a username.'),t('Form validation error for username was not displayed.'));
$this->assertNoRaw(t('You must enter an e-mail address.'),t('Form validation error for e-mail address was not displayed.'));