| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 21 | public function testPasswordHash(): void |
||
| 22 | { |
||
| 23 | $password = new PasswordHasher( |
||
| 24 | PASSWORD_BCRYPT, |
||
| 25 | [ |
||
| 26 | // minimum blowfish's value is enough for tests |
||
| 27 | 'cost' => 4, |
||
| 28 | ] |
||
| 29 | ); |
||
| 30 | |||
| 31 | $secret = 'secret'; |
||
| 32 | $hash = $password->hash($secret); |
||
| 33 | $this->assertTrue($password->validate($secret, $hash)); |
||
| 34 | $this->assertFalse($password->validate('test', $hash)); |
||
| 35 | } |
||
| 54 |