@@ -13,44 +13,44 @@ class HashFunctionTests
1313
1414 public function hash_hmac (): void
1515 {
16- assertType ('non-empty -string ' , hash_hmac ('md5 ' , 'data ' , 'key ' ));
17- assertType ('non-empty -string ' , hash_hmac ('sha256 ' , 'data ' , 'key ' ));
16+ assertType ('lowercase-string& non-falsy -string ' , hash_hmac ('md5 ' , 'data ' , 'key ' ));
17+ assertType ('lowercase-string& non-falsy -string ' , hash_hmac ('sha256 ' , 'data ' , 'key ' ));
1818 }
1919
2020 public function hash_hmac_file (string $ string ): void
2121 {
22- assertType ('non-empty -string|false ' , hash_hmac_file ('md5 ' , 'filename ' , 'key ' ));
23- assertType ('non-empty -string|false ' , hash_hmac_file ('sha256 ' , 'filename ' , 'key ' ));
24- assertType ('(non-empty -string|false) ' , hash_hmac_file ($ string , 'filename ' , 'key ' ));
22+ assertType ('(lowercase-string& non-falsy -string) |false ' , hash_hmac_file ('md5 ' , 'filename ' , 'key ' ));
23+ assertType ('(lowercase-string& non-falsy -string) |false ' , hash_hmac_file ('sha256 ' , 'filename ' , 'key ' ));
24+ assertType ('((lowercase-string& non-falsy -string) |false) ' , hash_hmac_file ($ string , 'filename ' , 'key ' ));
2525 }
2626
2727 public function hash ($ mixed ): void
2828 {
29- assertType ('non-empty -string ' , hash ('sha256 ' , 'data ' , false ));
30- assertType ('non-empty -string ' , hash ('sha256 ' , 'data ' , true ));
31- assertType ('non-empty -string ' , hash ('md5 ' , $ mixed , false ));
29+ assertType ('lowercase-string& non-falsy -string ' , hash ('sha256 ' , 'data ' , false ));
30+ assertType ('lowercase-string& non-falsy -string ' , hash ('sha256 ' , 'data ' , true ));
31+ assertType ('lowercase-string& non-falsy -string ' , hash ('md5 ' , $ mixed , false ));
3232 }
3333
3434 public function hash_file (): void
3535 {
36- assertType ('non-empty -string|false ' , hash_file ('sha256 ' , 'filename ' , false ));
37- assertType ('non-empty -string|false ' , hash_file ('sha256 ' , 'filename ' , true ));
38- assertType ('non-empty -string|false ' , hash_file ('crc32 ' , 'filename ' ));
36+ 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 ));
38+ assertType ('(lowercase-string& non-falsy -string|false ' , hash_file ('crc32 ' , 'filename ' ));
3939 }
4040
4141 public function hash_hkdf (): void
4242 {
43- assertType ('non-empty -string ' , hash_hkdf ('sha256 ' , 'key ' ));
43+ assertType ('lowercase-string& non-falsy -string ' , hash_hkdf ('sha256 ' , 'key ' ));
4444 }
4545
4646 public function hash_pbkdf2 (): void
4747 {
48- assertType ('non-empty -string ' , hash_pbkdf2 ('sha256 ' , 'password ' , 'salt ' , 1000 ));
48+ assertType ('lowercase-string& non-falsy -string ' , hash_pbkdf2 ('sha256 ' , 'password ' , 'salt ' , 1000 ));
4949 }
5050
5151 public function caseSensitive ()
5252 {
53- assertType ('non-empty -string ' , hash ('SHA256 ' , 'data ' ));
53+ assertType ('lowercase-string& non-falsy -string ' , hash ('SHA256 ' , 'data ' ));
5454 }
5555
5656 public function constantStrings (int $ type )
@@ -69,7 +69,7 @@ public function constantStrings(int $type)
6969 return ;
7070 }
7171
72- assertType ('non-empty -string ' , hash_pbkdf2 ($ algorithm , 'password ' , 'salt ' , 1000 ));
72+ assertType ('lowercase-string& non-falsy -string ' , hash_pbkdf2 ($ algorithm , 'password ' , 'salt ' , 1000 ));
7373 }
7474
7575}
0 commit comments