|
@@ 22-28 (lines=7) @@
|
| 19 |
|
$this->password = new Password(); |
| 20 |
|
} |
| 21 |
|
|
| 22 |
|
public function testNeedsRehash() |
| 23 |
|
{ |
| 24 |
|
$password = 'password'; |
| 25 |
|
$hash = password_hash('password', PASSWORD_DEFAULT); |
| 26 |
|
$result = $this->password->needsRehash($password, $hash, PASSWORD_DEFAULT, 12); |
| 27 |
|
$this->assertNotEquals($hash, $result); |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
public function testNeedsRehashNoRehash() |
| 31 |
|
{ |
|
@@ 30-36 (lines=7) @@
|
| 27 |
|
$this->assertNotEquals($hash, $result); |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
public function testNeedsRehashNoRehash() |
| 31 |
|
{ |
| 32 |
|
$password = 'password'; |
| 33 |
|
$hash = password_hash('password', PASSWORD_DEFAULT, ['cost' => 12]); |
| 34 |
|
$result = $this->password->needsRehash($password, $hash, PASSWORD_DEFAULT, 12); |
| 35 |
|
$this->assertEquals(false, $result); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
/** |
| 39 |
|
* @param string $password |