From 6b75f7bb82fce8403376a1dcb3b77a95b1ac2eb3 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 28 Jun 2007 15:04:47 +0000 Subject: [PATCH] more smaller tests --- ext/standard/tests/array/array_values.phpt | Bin 5251 -> 3060 bytes .../tests/array/array_values_64bit.phpt | Bin 5245 -> 0 bytes .../tests/array/array_values_errors.phpt | 40 +++++++++ .../tests/array/array_values_variation.phpt | 76 ++++++++++++++++++ .../array/array_values_variation_64bit.phpt | 74 +++++++++++++++++ 5 files changed, 190 insertions(+) delete mode 100644 ext/standard/tests/array/array_values_64bit.phpt create mode 100644 ext/standard/tests/array/array_values_errors.phpt create mode 100644 ext/standard/tests/array/array_values_variation.phpt create mode 100644 ext/standard/tests/array/array_values_variation_64bit.phpt diff --git a/ext/standard/tests/array/array_values.phpt b/ext/standard/tests/array/array_values.phpt index 0aeb5a85a39426bd3488a94c018b0ceadf97e7d0..e5e46ca3f72274f691fa1a38d081ea0beb7b4079 100644 GIT binary patch delta 29 icmZqH{31RQBuG>jS4)? zKxFA7^G=;N=P0~?-ABoD$>StPb!TB0ftUTOp4GR%3pY{}qIjJ1*V@d6vEUluPLjvu-)BVpx`FieZypougG8&^7$c>!|`G^H_<4)t>h^xW7u7`-82-Ihy_N7iXsOj zW~a`MIT^da#n>p2>$NCO`aSSk_T3L_hmsa*F!r9OsbF;o9-xxOtfyX$NPAsVssLq7 zRwzqEw{=*@v53LhIYpO^)Efqw#q`#x=?aJjBOe;tHa*)7BL{zc=(XVT?bR(lu0LE| zwV;p--hxS#=J?1KX^NtW4BcUhkWrNM4V7~&e4m;N2{tu}GDbBBApNUXr_PVEhqtzh zvRd+7EM&}qCKUCGQnpiqv2bt-&UxkzhcwuRLyVim0SK_a4;Sc>o)0idQVu1TWBD=U zKO^A0jF?ig#>fV(h4cb#zP7*w#7ll+Q5G*xUQ6v4>jCkV2{V@=-cxVHC%N( zR>y$;sy`LxgvxhIp$sLN@NAE;0;4hwDlvRa!=LV*30@n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|=g)-7)!m~ZX3Ji-haAM?yhCkgqQ@l0`=Qb$h^too zH<70DD+-%LNtk6Nj~f4jCKeHXt5V4^#0}=+vj64^R~WSYB2gKYF=f1LvKg)siE(8b zA%S$EY^s2+a|Tk&SMUzOd1>nZb=|)h;!5_bgZ1?TsNDcQUI5m0%=dQ^*uV!BK3ETp-&$knY-PZ$XN}`vBZr9<+hv_? z*w)?1XfuGxv|H4g(!-~CQL7MZY`u!D(+r1IY1pb1KHbQ4mj89#LQ!tY+-E z64`B<_-v7AzAfb^%s=`0x@=g{ghpp{sotxwnkML#P0*-|pjOmBE2=@Q5gw6=jZhg^ z#o4wj0kDf#GZoZ(Wu?2uN+m9B%5}jEMBdOB zL2X>D$lTDoB*^0$D`u}5_ViKkNH%LDWu@^}x`@JH;$sjt^$2d1JlE6@3YtyyR%(t3 zQ#Ws+a*l1eCmvtb?X|En=Zb6E#ah7ihxd9H11Q6Jy;Mswyam_Dw%=MC_FQYu(fUlQ z_Sm`w+;qhPd|YoB&g%-34O$arxNHj%%Cx!do(f?5r^$T6C9);zPjA20<&|nBHP7sT zTH&q4{IMn1aXyAR#eM7*eAEipvPG!Fxx}wU+=iF< +--INI-- +precision=14 +--FILE-- + expected +/* Invalid types */ +var_dump( array_values("") ); // Empty string +var_dump( array_values(100) ); // Integer +var_dump( array_values(new stdclass) ); // object + +echo "Done\n"; +?> +--EXPECTF-- +*** Testing error conditions *** + +Warning: Wrong parameter count for array_values() in %s on line %d +NULL + +Warning: Wrong parameter count for array_values() in %s on line %d +NULL + +Warning: array_values(): The argument should be an array in %s on line %d +NULL + +Warning: array_values(): The argument should be an array in %s on line %d +NULL + +Warning: array_values(): The argument should be an array in %s on line %d +NULL +Done diff --git a/ext/standard/tests/array/array_values_variation.phpt b/ext/standard/tests/array/array_values_variation.phpt new file mode 100644 index 0000000000..15da1a621e --- /dev/null +++ b/ext/standard/tests/array/array_values_variation.phpt @@ -0,0 +1,76 @@ +--TEST-- +Test array_values() function (variation) +--SKIPIF-- + +--INI-- +precision=14 +--FILE-- + $resource1, "b" => $resource2); +var_dump( array_values($arr_resource) ); + +echo "\n*** Testing array_values() with range checking ***\n"; +$arr_range = array( + 2147483647, + 2147483648, + -2147483647, + -2147483648, + -0, + 0, + -2147483649 +); +var_dump( array_values($arr_range) ); + +echo "\n*** Testing array_values() on an array created on the fly ***\n"; +var_dump( array_values(array(1,2,3)) ); +var_dump( array_values(array()) ); // null array + +echo "Done\n"; +?> +--EXPECTF-- +*** Testing array_values() with resource type *** +array(2) { + [0]=> + resource(%d) of type (stream) + [1]=> + resource(%d) of type (stream) +} + +*** Testing array_values() with range checking *** +array(7) { + [0]=> + int(2147483647) + [1]=> + float(2147483648) + [2]=> + int(-2147483647) + [3]=> + float(-2147483648) + [4]=> + int(0) + [5]=> + int(0) + [6]=> + float(-2147483649) +} + +*** Testing array_values() on an array created on the fly *** +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +array(0) { +} +Done diff --git a/ext/standard/tests/array/array_values_variation_64bit.phpt b/ext/standard/tests/array/array_values_variation_64bit.phpt new file mode 100644 index 0000000000..8b1e2c0b0e --- /dev/null +++ b/ext/standard/tests/array/array_values_variation_64bit.phpt @@ -0,0 +1,74 @@ +--TEST-- +Test array_values() function +--SKIPIF-- + +--INI-- +precision=14 +--FILE-- + $resource1, "b" => $resource2); +var_dump( array_values($arr_resource) ); + +echo "\n*** Testing array_values() with range checking ***\n"; +$arr_range = array( + 2147483647, + 2147483648, + -2147483647, + -2147483648, + -0, + 0, + -2147483649 +); +var_dump( array_values($arr_range) ); + +echo "\n*** Testing array_values() on an array created on the fly ***\n"; +var_dump( array_values(array(1,2,3)) ); +var_dump( array_values(array()) ); // null array + +?> +--EXPECTF-- +*** Testing array_values() with resource type *** +array(2) { + [0]=> + resource(%d) of type (stream) + [1]=> + resource(%d) of type (stream) +} + +*** Testing array_values() with range checking *** +array(7) { + [0]=> + int(2147483647) + [1]=> + int(2147483648) + [2]=> + int(-2147483647) + [3]=> + int(-2147483648) + [4]=> + int(0) + [5]=> + int(0) + [6]=> + int(-2147483649) +} + +*** Testing array_values() on an array created on the fly *** +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +array(0) { +} -- 2.50.1