You are here

function SecureSiteForceAlwaysTest::testSecureSiteForceAlwaysResetValid in Secure Site 8

Try valid password reset URL.

File

src/Tests/ForcedAuth/SecureSiteForceAlwaysTest.php, line 83
Contains Drupal\securesite\Tests\ForcedAuth\SecureSiteForceAlwaysTest

Class

SecureSiteForceAlwaysTest
Functional tests for page requests with authentication always forced.

Namespace

Drupal\securesite\Tests\ForcedAuth

Code

function testSecureSiteForceAlwaysResetValid() {
  sleep(1);

  // Password reset URL must be created at least one second after last log-in.
  $reset = user_pass_reset_url($this->user);
  sleep(1);

  // Password reset URL must be used at least one second after it is created.
  $this
    ->drupalGet($reset);
  $this
    ->assertResponse(200, t('Trying valid password reset URL.'));

  //todo fix next line
  $this
    ->assertText('This is a one-time login for ' . $this->user
    ->getName() . ' and will expire on', t('Checking for one-time log-in link.'));
}