function PhpPasswordTest::testEmptyHash

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php \Drupal\Tests\Core\Password\PhpPasswordTest::testEmptyHash()

Tests password check in case provided hash is NULL.

@covers ::check

File

core/tests/Drupal/Tests/Core/Password/PhpPasswordTest.php, line 134

Class

PhpPasswordTest
Unit tests for password hashing API.

Namespace

Drupal\Tests\Core\Password

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.