function UserPasswordResetTest::getResetURL
Retrieves password reset email and extracts the login link.
1 call to UserPasswordResetTest::getResetURL()
- UserPasswordResetTest::testUserPasswordResetWithAdditionalAjaxForm in core/modules/ user/ tests/ src/ FunctionalJavascript/ UserPasswordResetTest.php 
- Tests password reset functionality with an AJAX form.
File
- 
              core/modules/ user/ tests/ src/ FunctionalJavascript/ UserPasswordResetTest.php, line 115 
Class
- UserPasswordResetTest
- Ensure that password reset methods work as expected.
Namespace
Drupal\Tests\user\FunctionalJavascriptCode
public function getResetURL() {
  // Assume the most recent email.
  $_emails = $this->drupalGetMails();
  $email = end($_emails);
  $urls = [];
  preg_match('#.+user/reset/.+#', $email['body'], $urls);
  return $urls[0];
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
