You are here

protected function PasswordResetBehaviorsTest::setUp in Password Policy 8.3

Overrides BrowserTestBase::setUp

File

tests/src/Functional/PasswordResetBehaviorsTest.php, line 55

Class

PasswordResetBehaviorsTest
Tests password reset behaviors.

Namespace

Drupal\Tests\password_policy\Functional

Code

protected function setUp() {
  parent::setUp();

  // Set module install date far in the past so it does not affect regular
  // password expiration behaviors tested here.

  /* @see password_policy_install */
  $timestamp = \Drupal::service("date.formatter")
    ->format(0, 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE);
  \Drupal::state()
    ->set('password_policy.install_time', $timestamp);
}