function PhpPasswordArgon2idIntegrationTest::testArgon2idHashing
Tests that the argon2id password hashing algorithm is used.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Password/ PhpPasswordArgon2idIntegrationTest.php, line 38
Class
- PhpPasswordArgon2idIntegrationTest
- Argon2id specific integration tests for the PHP password hashing service.
Namespace
Drupal\KernelTests\Core\PasswordCode
public function testArgon2idHashing() : void {
$password = 'correct horse battery staple';
$hash = $this->container
->get(PasswordInterface::class)
->hash($password);
$this->assertStringStartsWith(implode([
'$',
PASSWORD_ARGON2ID,
'$v=19$m=1024,t=2,p=1$',
]), $hash);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.