public function UserPasswordResetTest::getResetURL

Retrieves password reset e-mail and extracts the login link.

1 call to UserPasswordResetTest::getResetURL()
UserPasswordResetTest::testUserPasswordReset in drupal/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php
Tests password reset functionality.

File

drupal/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php, line 102
Definition of Drupal\user\Tests\UserPasswordResetTest.

Class

UserPasswordResetTest
Tests resetting a user password.

Namespace

Drupal\user\Tests

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