@@ -14,43 +14,51 @@ class HashFunctionTests
1414 public function hash_hmac (): void
1515 {
1616 assertType ('lowercase-string&non-falsy-string ' , hash_hmac ('md5 ' , 'data ' , 'key ' ));
17+ assertType ('non-falsy-string ' , hash_hmac ('md5 ' , 'data ' , 'key ' , true ));
1718 assertType ('lowercase-string&non-falsy-string ' , hash_hmac ('sha256 ' , 'data ' , 'key ' ));
19+ assertType ('non-falsy-string ' , hash_hmac ('sha256 ' , 'data ' , 'key ' , true ));
1820 }
1921
2022 public function hash_hmac_file (string $ string ): void
2123 {
2224 assertType ('(lowercase-string&non-falsy-string)|false ' , hash_hmac_file ('md5 ' , 'filename ' , 'key ' ));
25+ assertType ('non-falsy-string|false ' , hash_hmac_file ('md5 ' , 'filename ' , 'key ' , true ));
2326 assertType ('(lowercase-string&non-falsy-string)|false ' , hash_hmac_file ('sha256 ' , 'filename ' , 'key ' ));
27+ assertType ('non-falsy-string|false ' , hash_hmac_file ('sha256 ' , 'filename ' , 'key ' , true ));
2428 assertType ('((lowercase-string&non-falsy-string)|false) ' , hash_hmac_file ($ string , 'filename ' , 'key ' ));
29+ assertType ('(non-falsy-string|false) ' , hash_hmac_file ($ string , 'filename ' , 'key ' , true ));
2530 }
2631
2732 public function hash ($ mixed ): void
2833 {
2934 assertType ('lowercase-string&non-falsy-string ' , hash ('sha256 ' , 'data ' , false ));
30- assertType ('lowercase-string& non-falsy-string ' , hash ('sha256 ' , 'data ' , true ));
35+ assertType ('non-falsy-string ' , hash ('sha256 ' , 'data ' , true ));
3136 assertType ('lowercase-string&non-falsy-string ' , hash ('md5 ' , $ mixed , false ));
3237 }
3338
3439 public function hash_file (): void
3540 {
3641 assertType ('(lowercase-string&non-falsy-string)|false ' , hash_file ('sha256 ' , 'filename ' , false ));
37- assertType ('(lowercase-string& non-falsy-string) |false ' , hash_file ('sha256 ' , 'filename ' , true ));
42+ assertType ('non-falsy-string|false ' , hash_file ('sha256 ' , 'filename ' , true ));
3843 assertType ('(lowercase-string&non-falsy-string)|false ' , hash_file ('crc32 ' , 'filename ' ));
44+ assertType ('non-falsy-string|false ' , hash_file ('crc32 ' , 'filename ' , true ));
3945 }
4046
4147 public function hash_hkdf (): void
4248 {
43- assertType ('lowercase-string& non-falsy-string ' , hash_hkdf ('sha256 ' , 'key ' ));
49+ assertType ('non-falsy-string ' , hash_hkdf ('sha256 ' , 'key ' ));
4450 }
4551
4652 public function hash_pbkdf2 (): void
4753 {
4854 assertType ('lowercase-string&non-falsy-string ' , hash_pbkdf2 ('sha256 ' , 'password ' , 'salt ' , 1000 ));
55+ assertType ('non-falsy-string ' , hash_pbkdf2 ('sha256 ' , 'password ' , 'salt ' , 1000 , 0 , true ));
4956 }
5057
5158 public function caseSensitive ()
5259 {
5360 assertType ('lowercase-string&non-falsy-string ' , hash ('SHA256 ' , 'data ' ));
61+ assertType ('non-falsy-string ' , hash ('SHA256 ' , 'data ' , true ));
5462 }
5563
5664 public function constantStrings (int $ type )
@@ -70,6 +78,7 @@ public function constantStrings(int $type)
7078 }
7179
7280 assertType ('lowercase-string&non-falsy-string ' , hash_pbkdf2 ($ algorithm , 'password ' , 'salt ' , 1000 ));
81+ assertType ('non-falsy-string ' , hash_pbkdf2 ($ algorithm , 'password ' , 'salt ' , 1000 , 0 , true ));
7382 }
7483
7584}
0 commit comments