diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php index 4bda214..5a72cb1 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -44,7 +44,7 @@ function testRegistrationWithEmailVerification() { $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail)); $new_user = reset($accounts); $this->assertTrue($new_user->isActive(), 'New account is active after registration.'); - $resetURL = $this->getResetURL(); + $resetURL = user_pass_reset_url($new_user); $this->drupalGet($resetURL); $this->assertTitle(t('Set Password | Drupal'), 'Page title is "Set Password".'); @@ -280,17 +280,4 @@ function testRegistrationWithUserFields() { $this->assertEqual($new_user->test_user_field[2]->value, $value + 2, format_string('@js : The field value was correclty saved.', array('@js' => $js))); } } - - /** - * Retrieves password set email and extracts the login link. - */ - public function getResetURL() { - // Assume the most recent email. - $_emails = $this->drupalGetMails(); - $email = end($_emails); - $urls = array(); - preg_match('#.+user/reset/.+#', $email['body'], $urls); - - return $urls[0]; - } }