/** * @test */ public function hashAndValidatePasswordWithNotMatchingPasswordOrParametersFails() { $strategy = new Pbkdf2HashingStrategy(8, 1000, 64, 'sha256'); $derivedKeyWithSalt = $strategy->hashPassword('password', 'MyStaticSalt'); $this->assertFalse($strategy->validatePassword('pass', $derivedKeyWithSalt, 'MyStaticSalt'), 'Different password should not match'); $this->assertFalse($strategy->validatePassword('password', $derivedKeyWithSalt, 'SomeSalt'), 'Different static salt should not match'); $strategy = new Pbkdf2HashingStrategy(8, 99, 64, 'sha256'); $this->assertFalse($strategy->validatePassword('password', $derivedKeyWithSalt, 'MyStaticSalt'), 'Different iteration should not match'); }