| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 3 | class PasswordEncryptor_PBKDF2Test extends SapphireTest |
||
| 4 | { |
||
| 5 | public function testGetIterations() |
||
| 6 | { |
||
| 7 | $encryptor = new PasswordEncryptor_PBKDF2('sha512', 12345); |
||
| 8 | $this->assertSame(12345, $encryptor->getIterations()); |
||
|
|
|||
| 9 | } |
||
| 10 | |||
| 11 | public function testEncrypt() |
||
| 12 | { |
||
| 13 | $encryptor = new PasswordEncryptor_PBKDF2('sha512', 10000); |
||
| 14 | $salt = 'predictablesaltforunittesting'; |
||
| 15 | $result = $encryptor->encrypt('opensesame', $salt); |
||
| 16 | $this->assertSame( |
||
| 17 | '6bafcacb90', |
||
| 18 | substr($result, 0, 10), |
||
| 19 | 'Hashed password with predictable salt did not match fixtured expectation' |
||
| 20 | ); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @expectedException Exception |
||
| 25 | * @expectedExceptionMessage Hash algorithm "foobar" not found |
||
| 26 | */ |
||
| 27 | public function testThrowsExceptionWhenInvalidAlgorithmIsProvided() |
||
| 30 | } |
||
| 31 | } |
||
| 32 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.