public function UserPasswordResetTestCase::getResetURL

Retrieves password reset email and extracts the login link.

1 call to UserPasswordResetTestCase::getResetURL()
UserPasswordResetTestCase::testUserPasswordReset in drupal/modules/user/user.test
Tests password reset functionality.

File

drupal/modules/user/user.test, line 471
Tests for user.module.

Class

UserPasswordResetTestCase
Tests resetting a user password.

Code

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];
}