t('Multiple Email New User Tests'), 'description' => t('User registers for the site, and interacts with the module.'), 'group' => t('Multiple Email'), ); } /** * Implementation of setUp(). */ function setUp() { // Enable the Multiple User module parent::setUp('multiple_email'); // Create user and login $new_user = $this->drupalCreateUser(array('multiple emails')); $this->drupalLogin($new_user); } /** * Test that the user's registered email address appears in the list. */ function testEmailAppears() { $this->drupalGet('user/'. $this->loggedInUser->uid .'/edit/email-addresses'); $this->assertRaw($this->loggedInUser->mail, t('Registered email successfully added')); } /** * Test that the user can add a new email address. */ function testAddEmail() { // New user creates $box = array(); $box['email'] = 'user1@example.com'; $this->drupalPost('user/'. $this->loggedInUser->uid .'/edit/email-addresses/add', $box, t('Register')); $this->assertRaw(t("The email address '%email' has been added to your account and is awaiting confirmation.", array('%email' => 'user1@example.com')), t('Email successfully added.'), 'Form'); } }