You are here

protected function RedirectMethodTest::clickMailOneTimeLoginLink in Entity Legal 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/RedirectMethodTest.php \Drupal\Tests\entity_legal\Functional\RedirectMethodTest::clickMailOneTimeLoginLink()
  2. 4.0.x tests/src/Functional/RedirectMethodTest.php \Drupal\Tests\entity_legal\Functional\RedirectMethodTest::clickMailOneTimeLoginLink()

Clicks on the email password reset one-time-login link.

1 call to RedirectMethodTest::clickMailOneTimeLoginLink()
RedirectMethodTest::_testRedirectMethod in tests/src/Functional/RedirectMethodTest.php
Redirection method test.

File

tests/src/Functional/RedirectMethodTest.php, line 190

Class

RedirectMethodTest
Tests the 'redirect' plugin.

Namespace

Drupal\Tests\entity_legal\Functional

Code

protected function clickMailOneTimeLoginLink() {

  // Assume the most recent email.
  $emails = $this
    ->getMails();
  $email = end($emails);
  $urls = [];
  preg_match('#.+user/reset/.+#', $email['body'], $urls);
  $this
    ->drupalGet($urls[0]);
}