From: Antony Dovgal Date: Tue, 13 Feb 2007 12:59:53 +0000 (+0000) Subject: new/improved tests X-Git-Tag: php-5.2.2RC1~412 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29a9ba96391c7397d214041a2776347a4b12e3eb;p=php new/improved tests --- diff --git a/Zend/tests/018.phpt b/Zend/tests/018.phpt new file mode 100644 index 0000000000..ea875c678a --- /dev/null +++ b/Zend/tests/018.phpt @@ -0,0 +1,36 @@ +--TEST-- +constant() tests +--FILE-- + +--EXPECTF-- +Warning: Wrong parameter count for constant() in %s on line %d +NULL + +Warning: Wrong parameter count for constant() in %s on line %d +NULL + +Warning: constant(): Couldn't find constant in %s on line %d +NULL + +Notice: Array to string conversion in %s on line %d + +Warning: constant(): Couldn't find constant Array in %s on line %d +NULL +int(1) +string(4) "test" +Done diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt new file mode 100644 index 0000000000..efc059cff5 --- /dev/null +++ b/ext/standard/tests/file/flock.phpt @@ -0,0 +1,64 @@ +--TEST-- +flock() tests +--FILE-- + +--EXPECTF-- +Warning: flock() expects at least 2 parameters, 0 given in %s on line %d +NULL + +Warning: flock() expects parameter 1 to be resource, string given in %s on line %d +NULL + +Warning: flock(): %d is not a valid stream resource in %s on line %d +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +int(0) +bool(true) +int(0) +bool(true) +int(0) +bool(true) +int(0) +bool(true) + +Warning: flock(): Illegal operation argument in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/general_functions/ini_get_all.phpt b/ext/standard/tests/general_functions/ini_get_all.phpt new file mode 100644 index 0000000000..6016873fd9 --- /dev/null +++ b/ext/standard/tests/general_functions/ini_get_all.phpt @@ -0,0 +1,51 @@ +--TEST-- +ini_get_all() tests +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +string(5) "array" + +Warning: ini_get_all(): Unable to find extension '' in %s on line %d +bool(false) + +Warning: ini_get_all(): Unable to find extension 'nosuchextension' in %s on line %d +bool(false) +array(0) { +} +array(2) { + ["pcre.backtrack_limit"]=> + array(3) { + ["global_value"]=> + string(6) "100000" + ["local_value"]=> + string(6) "100000" + ["access"]=> + int(7) + } + ["pcre.recursion_limit"]=> + array(3) { + ["global_value"]=> + string(6) "100000" + ["local_value"]=> + string(6) "100000" + ["access"]=> + int(7) + } +} + +Warning: ini_get_all() expects at most 1 parameter, 2 given in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/strings/convert_cyr_string.phpt b/ext/standard/tests/strings/convert_cyr_string.phpt new file mode 100644 index 0000000000..a6f3657312 --- /dev/null +++ b/ext/standard/tests/strings/convert_cyr_string.phpt @@ -0,0 +1,54 @@ +--TEST-- +basic convert_cyr_string() tests +--FILE-- + +--EXPECTF-- +Warning: Wrong parameter count for convert_cyr_string() in %s on line %d +NULL + +Warning: Wrong parameter count for convert_cyr_string() in %s on line %d +NULL + +Warning: Wrong parameter count for convert_cyr_string() in %s on line %d +NULL + +Warning: convert_cyr_string(): Unknown source charset: in %s on line %d + +Warning: convert_cyr_string(): Unknown destination charset: in %s on line %d +string(0) "" + +Notice: Array to string conversion in %s on line %d + +Notice: Array to string conversion in %s on line %d + +Notice: Array to string conversion in %s on line %d +string(5) "Array" + +Warning: convert_cyr_string(): Unknown source charset: q in %s on line %d +string(6) "[[[[[[" +string(6) "[[[[[[" +string(6) "[[[[[[" +string(6) "[[[[[[" +string(6) "[[[[[[" + +Warning: convert_cyr_string(): Unknown destination charset: q in %s on line %d +string(6) "[[[[[[" +string(0) "" +Done diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt index 5368178e11..ce178f684e 100644 --- a/ext/standard/tests/strings/crypt.phpt +++ b/ext/standard/tests/strings/crypt.phpt @@ -24,9 +24,20 @@ echo (CRYPT_EXT_DES) ? ((crypt($str, $salt2) === $res_2) ? 'EXT' : 'EXT - ERROR echo (CRYPT_MD5) ? ((crypt($str, $salt3) === $res_3) ? 'MD5' : 'MD5 - ERROR') : 'MD5', "\n"; echo (CRYPT_BLOWFISH) ? ((crypt($str, $salt4) === $res_4) ? 'BLO' : 'BLO - ERROR') : 'BLO', "\n"; +var_dump(crypt($str)); +var_dump(crypt()); +var_dump(crypt("", "", "")); + ?> ---EXPECT-- +--EXPECTF-- STD EXT MD5 BLO +string(%d) "%s" + +Warning: crypt() expects at least 1 parameter, 0 given in %s on line %d +NULL + +Warning: crypt() expects at most 2 parameters, 3 given in %s on line %d +NULL