From: Robert Nicholson Date: Fri, 26 Oct 2007 11:02:04 +0000 (+0000) Subject: new testcases for max and min X-Git-Tag: php-5.2.5RC2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6900cb61dbe93d888d8358d449192bcb5f7a460;p=php new testcases for max and min --- diff --git a/ext/standard/tests/array/max_basic.phpt b/ext/standard/tests/array/max_basic.phpt new file mode 100644 index 0000000000..ca99ccb5f2 --- /dev/null +++ b/ext/standard/tests/array/max_basic.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test return type and value for expected input max() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing sequences of numbers *** +int(2) +int(2) +float(2.11) +string(1) "t" +bool(true) +bool(true) +int(1) +bool(true) +array(2) { + [0]=> + int(2) + [1]=> + int(3) +} + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/max_error.phpt b/ext/standard/tests/array/max_error.phpt new file mode 100644 index 0000000000..086ecb551c --- /dev/null +++ b/ext/standard/tests/array/max_error.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test wrong number of arguments for min() +--INI-- +--FILE-- + +--EXPECTF-- + +*** Testing Error Conditions *** + +Warning: max(): At%seast one %s on line %d +NULL + +Warning: Wrong parameter count for max() in %s on line %d +NULL + +Warning: max(): Array must contain at%seast one element in %s on line %d +bool(false) + +Warning: Wrong parameter count for max() in %s on line %d +NULL diff --git a/ext/standard/tests/array/max_variation1.phpt b/ext/standard/tests/array/max_variation1.phpt new file mode 100644 index 0000000000..22732881f5 --- /dev/null +++ b/ext/standard/tests/array/max_variation1.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test variations in usage of max() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing boundary conditions *** +int(2147483646) +float(2147483648) +float(2147483648) +int(-2147483646) +int(-2147483647) +int(-2147483647) + +*** Testing large number of arguments *** +int(21) + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/max_variation2.phpt b/ext/standard/tests/array/max_variation2.phpt new file mode 100644 index 0000000000..fe95c17bed --- /dev/null +++ b/ext/standard/tests/array/max_variation2.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test variations in usage of max() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing arrays *** +int(2) +int(2) +float(2.11) +string(1) "t" +bool(true) +bool(true) +int(1) +bool(true) +array(2) { + [0]=> + int(2) + [1]=> + int(3) +} +int(2147483646) +float(2147483648) +float(2147483648) +int(-2147483646) +int(-2147483647) +int(-2147483647) + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/min_basic.phpt b/ext/standard/tests/array/min_basic.phpt new file mode 100644 index 0000000000..76c5969cde --- /dev/null +++ b/ext/standard/tests/array/min_basic.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test return type and value for expected input min() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing sequences of numbers *** +int(1) +int(-2) +float(2.09) +string(0) "" +bool(false) +bool(false) +bool(false) +int(0) +int(0) + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/min_error.phpt b/ext/standard/tests/array/min_error.phpt new file mode 100644 index 0000000000..d296a962e9 --- /dev/null +++ b/ext/standard/tests/array/min_error.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test wrong number of arguments for min() +--INI-- +--FILE-- + +--EXPECTF-- + +*** Testing Error Conditions *** + +Warning: min(): At%seast one %s on line %d +NULL + +Warning: Wrong parameter count for min() in %s on line %d +NULL + +Warning: min(): Array must contain at%seast one element in %s on line %d +bool(false) + +Warning: Wrong parameter count for min() in %s on line %d +NULL diff --git a/ext/standard/tests/array/min_variation1.phpt b/ext/standard/tests/array/min_variation1.phpt new file mode 100644 index 0000000000..25dffdb7db --- /dev/null +++ b/ext/standard/tests/array/min_variation1.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test variations in usage of min() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing boundary conditions *** +int(2147483645) +int(2147483647) +int(2147483646) +int(-2147483647) +float(-2147483648) +float(-2147483649) + +*** Testing large number of arguments *** +int(0) + +Done \ No newline at end of file diff --git a/ext/standard/tests/array/min_variation2.phpt b/ext/standard/tests/array/min_variation2.phpt new file mode 100644 index 0000000000..d2056fd255 --- /dev/null +++ b/ext/standard/tests/array/min_variation2.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test variations in usage of min() +--INI-- +--FILE-- + +--EXPECT-- + +*** Testing arrays *** +int(1) +int(-2) +float(2.09) +string(0) "" +bool(false) +bool(false) +bool(false) +int(0) +int(0) +int(2147483645) +int(2147483647) +int(2147483646) +int(-2147483647) +float(-2147483648) +float(-2147483649) + +Done \ No newline at end of file