/**
* The password hasher under test.
*/
protected PasswordInterface
$passwordHasher;
/**
* {@inheritdoc}
*/
protected function setUp(): void
{ parent::
setUp();
$this->password =
$this->
randomMachineName();
$this->passwordHasher =
new PhpPassword(PASSWORD_BCRYPT,
['cost' => 5
]);
$this->passwordHash =
$this->passwordHasher->
hash($this->password
);
} /**
* Tests a password needs update.
*
* @covers ::hash
* @covers ::needsRehash
*/
public function testPasswordNeedsUpdate() { $weakHash =
(new PhpPassword(PASSWORD_BCRYPT,
['cost' => 4
]))->
hash($this->password
);