summaryrefslogtreecommitdiffstats
path: root/tests/crypt_gensalt.phpt
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-09-13 10:13:12 +0200
committerRemi Collet <remi@php.net>2024-09-13 10:13:12 +0200
commitef4627a6a618b460cbbea109e3e0522c891be72c (patch)
tree466a4678a4c18d4a636f3375f4b72e3045cde437 /tests/crypt_gensalt.phpt
parent5bca3985ce597abd2db703e0944160a8f73dd84a (diff)
More bindings (function missing in php)
- add crypt_gensalt(?string $salt = null, int $count = 0): ?string {} - add crypt_preferred_method(): ?string {} - add crypt_checksalt(string $salt): int {} and bump version to 1.1.0-dev (new functions)
Diffstat (limited to 'tests/crypt_gensalt.phpt')
-rw-r--r--tests/crypt_gensalt.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/crypt_gensalt.phpt b/tests/crypt_gensalt.phpt
new file mode 100644
index 0000000..b838a04
--- /dev/null
+++ b/tests/crypt_gensalt.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Test crypt_gensalt
+--FILE--
+<?php
+var_dump(crypt_gensalt(XPASS_CRYPT_STD_DES));
+var_dump(crypt_gensalt(XPASS_CRYPT_EXT_DES));
+var_dump(crypt_gensalt(XPASS_CRYPT_MD5));
+var_dump(crypt_gensalt(XPASS_CRYPT_BLOWFISH));
+var_dump(crypt_gensalt(XPASS_CRYPT_SHA256));
+var_dump(crypt_gensalt(XPASS_CRYPT_SHA512));
+var_dump(crypt_gensalt(XPASS_CRYPT_SCRYPT));
+var_dump(crypt_gensalt(XPASS_CRYPT_GOST_YESCRYPT));
+var_dump(crypt_gensalt(XPASS_CRYPT_YESCRYPT));
+
+?>
+--EXPECTF--
+string(2) "%s"
+string(9) "_%s"
+string(11) "$1$%s"
+string(29) "$2y$%s"
+string(19) "$5$%s"
+string(19) "$6$%s"
+string(36) "$7$%s"
+string(30) "$gy$%s"
+string(29) "$y$j%s"