t('Email registration.'), 'description' => t('Test the email registration module.'), 'group' => t('Email registration'), ); } /** * Implementation of setUp(). */ public function setUp() { parent::setUp('email_registration'); // Configure to allow set password. variable_set('user_email_verification', FALSE); } /** * Test various behaviors for anonymous users. */ public function testRegistration() { variable_set('user_register', USER_REGISTER_VISITORS); // Try to register a user. $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->drupalLogout(); $login = array( 'name' => $name . '@example.com', 'pass' => $pass, ); $this->drupalPost('user/login', $login, t('Log in')); // Get the uid. $accounts = user_load_multiple(array(), array('mail' => $name . '@example.com')); $new_user = reset($accounts); // Confirm the user was created and logged in with expected username. $this->assertRaw('