function PhpPasswordBcryptIntegrationTest::testBcryptHashing
Tests that the bcrypt password hashing algorithm is used.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Password/ PhpPasswordBcryptIntegrationTest.php, line 34
Class
- PhpPasswordBcryptIntegrationTest
- Bcrypt specific integration tests for the PHP password hashing service.
Namespace
Drupal\KernelTests\Core\PasswordCode
public function testBcryptHashing() : void {
$password = 'correct horse battery staple';
$hash = $this->container
->get(PasswordInterface::class)
->hash($password);
$this->assertStringStartsWith(implode([
'$',
PASSWORD_BCRYPT,
'$05$',
]), $hash);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.