diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php index 25d592e..4d79c92 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php @@ -98,28 +98,24 @@ function testUserAdmin() { $account1 = user_load($user_d->uid, TRUE); $this->assertEqual($account1->status, 1, 'User D unblocked'); $this->assertMail("to", $account1->mail, "Activation mail sent to user D"); - } - function testNotificationEmailAddress(){ - - // Test setting notification email sender address + function testNotificationEmailAddress() { + // Test that the Notification E-mail address field is present on the config page. $admin_user = $this->drupalCreateUser(array('administer users')); $this->drupalLogin($admin_user); $this->drupalGet('admin/config/people/accounts'); - $this->assertText('E-mail address', 'Notification E-mail address field exists'); + $this->assertRaw('id="edit-mail-notification-address"', 'Notification E-mail address field exists'); $this->drupalLogout(); - - - // Test custom user registration approval email address(es) + // Test custom user registration approval email address(es). $config = config('user.settings'); - // Allow users to register with admin approval + // Allow users to register with admin approval. $config ->set('verify_mail', TRUE) ->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) ->save(); - // Set the site and notification email addresses + // Set the site and notification email addresses. $system = config('system.site'); $server_address = $this->randomName() . '@example.com'; $notify_address = $this->randomName() . '@example.com'; @@ -127,24 +123,24 @@ function testNotificationEmailAddress(){ ->set('mail', $server_address) ->set('mail_notification', $notify_address) ->save(); - // Register a new user account + // Register a new user account. $edit = array(); $edit['name'] = $name = $this->randomName(); $edit['mail'] = $mail = $edit['name'] . '@example.com'; $this->drupalPost('user/register', $edit, t('Create new account')); $subject = 'Account details for ' . $edit['name'] . ' at ' . $system->get('name') . ' (pending admin approval)'; - // Ensure admin mail sent to Notification E-mail + // Ensure that admin notification mail is sent to the configured Notification E-mail address. $admin_mail = $this->drupalGetMails(array( 'to' => $notify_address, 'from' => $server_address, - 'subject' => $subject + 'subject' => $subject, )); $this->assertTrue(count($admin_mail), 'New user mail to admin is sent to configured Notification E-mail address'); - // Ensure user mail sent from Notification E-mail + // Ensure that user notification mail is sent from the configured Notification E-mail address. $user_mail = $this->drupalGetMails(array( 'to' => $edit['mail'], 'from' => $notify_address, - 'subject' => $subject + 'subject' => $subject, )); $this->assertTrue(count($user_mail), 'New user mail to user is sent from configured Notification E-mail address'); }