function LegacyPasswordHashingTest::testEmptyHash

Same name in other branches
  1. 11.x core/modules/phpass/tests/src/Unit/LegacyPasswordHashingTest.php \Drupal\Tests\phpass\Unit\LegacyPasswordHashingTest::testEmptyHash()

Tests password validation when the hash is NULL.

@covers ::check

File

core/modules/phpass/tests/src/Unit/LegacyPasswordHashingTest.php, line 124

Class

LegacyPasswordHashingTest
Unit tests for password hashing API.

Namespace

Drupal\Tests\phpass\Unit

Code

public function testEmptyHash() : void {
    $this->assertFalse($this->passwordHasher
        ->check($this->password, NULL));
    $this->assertFalse($this->passwordHasher
        ->check($this->password, ''));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.