public function PasswordHashingTest::testWithinBounds in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Password/PasswordHashingTest.php \Drupal\Tests\Core\Password\PasswordHashingTest::testWithinBounds()
Tests the hash count boundaries are enforced.
@covers ::enforceLog2Boundaries
File
- core/
tests/ Drupal/ Tests/ Core/ Password/ PasswordHashingTest.php, line 73 - Contains \Drupal\Tests\Core\Password\PasswordHashingTest.
Class
- PasswordHashingTest
- Unit tests for password hashing API.
Namespace
Drupal\Tests\Core\PasswordCode
public function testWithinBounds() {
$hasher = new FakePhpassHashedPassword();
$this
->assertEquals(PhpassHashedPassword::MIN_HASH_COUNT, $hasher
->enforceLog2Boundaries(1), "Min hash count enforced");
$this
->assertEquals(PhpassHashedPassword::MAX_HASH_COUNT, $hasher
->enforceLog2Boundaries(100), "Max hash count enforced");
}