You are here

public function SecureSiteForceAlwaysFunctionalTest::testSecureSiteForceAlwaysResetValid in Secure Site 7.2

Same name and namespace in other branches
  1. 6.2 securesite.test \SecureSiteForceAlwaysFunctionalTest::testSecureSiteForceAlwaysResetValid()

Try valid password reset URL.

File

./securesite.test, line 997
Tests for Secure Site module.

Class

SecureSiteForceAlwaysFunctionalTest
Functional tests for page requests with authentication always forced.

Code

public function testSecureSiteForceAlwaysResetValid() {
  sleep(1);

  // Password reset URL must be created at least one second after last log-in.
  $reset = user_pass_reset_url(array_shift(user_load_multiple(array(), $this->user->uid)));
  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.'));
  $this
    ->assertText('This is a one-time login for ' . $this->user->name . ' and will expire on', t('Checking for one-time log-in link.'));
}