You are here

protected function PasswordHashingTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Password/PasswordHashingTest.php \Drupal\Tests\Core\Password\PasswordHashingTest::setUp()
  2. 9 core/tests/Drupal/Tests/Core/Password/PasswordHashingTest.php \Drupal\Tests\Core\Password\PasswordHashingTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Password/PasswordHashingTest.php, line 60
Contains \Drupal\Tests\Core\Password\PasswordHashingTest.

Class

PasswordHashingTest
Unit tests for password hashing API.

Namespace

Drupal\Tests\Core\Password

Code

protected function setUp() : void {
  parent::setUp();
  $this->password = $this
    ->randomMachineName();
  $this->passwordHasher = new PhpassHashedPassword(1);
  $this->hashedPassword = $this->passwordHasher
    ->hash($this->password);
  $this->md5HashedPassword = 'U' . $this->passwordHasher
    ->hash(md5($this->password));
}