| @@ 31-37 (lines=7) @@ | ||
| 28 | /** |
|
| 29 | * |
|
| 30 | */ |
|
| 31 | public function testNeedsRehash() |
|
| 32 | { |
|
| 33 | $password = 'password'; |
|
| 34 | $hash = \password_hash('password', PASSWORD_DEFAULT); |
|
| 35 | $result = $this->password->needsRehash($password, $hash, PASSWORD_DEFAULT, 12); |
|
| 36 | $this->assertNotEquals($hash, $result); |
|
| 37 | } |
|
| 38 | ||
| 39 | /** |
|
| 40 | * |
|
| @@ 42-48 (lines=7) @@ | ||
| 39 | /** |
|
| 40 | * |
|
| 41 | */ |
|
| 42 | public function testNeedsRehashNoRehash() |
|
| 43 | { |
|
| 44 | $password = 'password'; |
|
| 45 | $hash = password_hash('password', PASSWORD_DEFAULT, ['cost' => 12]); |
|
| 46 | $result = $this->password->needsRehash($password, $hash, PASSWORD_DEFAULT, 12); |
|
| 47 | $this->assertEquals(false, $result); |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * @param string $password |
|