You are here

protected function PasswordPolicyForcePasswordChangeTestCase::getPasswordResetUrlFromMail in Password Policy 7

Parses the last sent e-mail and returns the one-time login link URL.

Copy of OpenIDWebTestCase::getPasswordResetURLFromMail().

1 call to PasswordPolicyForcePasswordChangeTestCase::getPasswordResetUrlFromMail()
PasswordPolicyForcePasswordChangeTestCase::testForceChangeOnReset in tests/password_policy.test
Tests "Force password change on reset" setting.

File

tests/password_policy.test, line 775
Functional tests for Password policy module.

Class

PasswordPolicyForcePasswordChangeTestCase
Tests of forcing password changes.

Code

protected function getPasswordResetUrlFromMail() {
  $mails = $this
    ->drupalGetMails();
  $mail = end($mails);
  preg_match('@.+user/reset/.+@', $mail['body'], $matches);
  return $matches[0];
}