Commit 1c1c453a authored by greggles's avatar greggles

Issue #377262 by greggles: Test that immediate login works if enabled, remove...

Issue #377262 by greggles: Test that immediate login works if enabled, remove code that forces the login
parent 74db22bf
......@@ -47,14 +47,6 @@ function email_registration_user_insert(&$edit, &$account, $category = NULL) {
->execute();
$edit['name'] = $new_name;
// If email verification is off and a new user is the one creating an account,
// log the new user in with his correct name.
global $user;
if (!variable_get('user_email_verification', 1) && $user->uid == 0) {
$user = $account;
$user->name = $new_name;
}
$account->name = $new_name;
return;
}
......
......@@ -49,8 +49,21 @@ class EmailRegistrationTestCase extends DrupalWebTestCase {
);
$this->drupalPost('user/login', $login, t('Log in'));
// Really basic confirmatino that the user was created and logged in.
// Really basic confirmation that the user was created and logged in.
$this->assertRaw('<title>' . $name . ' | Drupal</title>', t('User properly created, logged in.'));
// Now try the immediate login.
$this->drupalLogout();
variable_set('user_email_verification', 0);
$name = $this->randomName();
$pass = $this->randomName(10);
$register = array(
'mail' => $name . '@example.com',
'pass[pass1]' => $pass,
'pass[pass2]' => $pass,
);
$this->drupalPost('/user/register', $register, t('Create new account'));
$this->assertRaw('Registration successful. You are now logged in.', t('User properly created, immediately logged in.'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment