From d6940afe0b424f4a57cb27ec508e0b8a0e7a4e6b Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 28 Jun 2007 15:04:16 +0000 Subject: [PATCH] more smaller tests --- ext/standard/tests/array/array_values.phpt | Bin 8161 -> 4894 bytes .../tests/array/array_values_errors.phpt | 58 +++++++++++++ .../tests/array/array_values_variation.phpt | 76 ++++++++++++++++++ .../array/array_values_variation_64bit.phpt | 74 +++++++++++++++++ 4 files changed, 208 insertions(+) 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 f3399c1fc1fa0f4e8fe7bf8db21ab7d4f8614d50..b281325ee7423b31a11b423309f73d86e3835072 100644 GIT binary patch delta 34 ocmaE8KTmCf#>Uo#EbK1%d8sjZN}D%x%Cm3YC!)p93KHQ00Or68(EtDd literal 8161 zcmeHMdr#X)5bwX|Pcdgv$)PdWA-s-*s-meH9YW{;_0)2T9A`t^I(D>nD5&apznOjc zk;HI4db$S)5%0{-?7a8q;JO#R^9$FtE?AaBztxC!Dp%bXUB=Si4HX=1tV`7iym z{u|u)^UK*}W<_Ig&fcC4`llCz^ZxrD{CEi67K|e1*x9FO2Kgk)ASa#pIZiojb%s$6 zvpC3cHH9>Z@9frr_3{Xn_fPw%dB#~7Wq917-$mk^{z=cAx48~yJk8VmZpMC+W>$;^ zM-kVeWH!$MH3PuwC<}QsBNvoV;Tvc9oF^Fsag4??kWRyxr&F<(dPG2gbX9(WWCT$% zVz(@VWIkm)3Q^CU5ELTT`le;EaFT+(zP=6=+$g!On2hmF6Bq_r6e`4iy9)lZBm{(QWUPd3IpK;SojG9*QRnvK`XXR_QE{_F&|FwYNi`or;kczh3s* z@aEOYIewg8o}9EH=X2JEaS&(tk<8;5Rns|+-BqNjbxZcKgIVr+plUN^jn9PFkUM?}W zVB3bPR<;c-3(L`3i?D#b0}Ip`SAzQ1=5G;=0saxM5Y32xCNp z0PcVB;=uZp7>70iQXhKo1h{M)284Cxe;EW~CU_gUyFu=HR9Do3un{bRC z$@u`|C}yCgEF+I02NEAe+_5*7$RVQ;qj-l#C&rFCSVmW?#~?Zg+2Mr@JfW zfm!Z}rEAu^)NsXePb@w9EB+LmeJbCELK$!};lUnZ1qM0|A~9@4!=LV*F;agG;rm||5?lZX*7$`;F~pWuZUjp%k8G7jk&6rH3*9b`Gj z5?W=6?|J6%ev-3m##e1k*k@EW3gaNlj7&QGh$iX?zfKb-Vu%Rl_@wvh6d?@SejKM6 zl`&=9G}#1UL@Zqyhq!?`V4BLO>s%12+G})Bq0S|$&|++E}@}}WOY#K zsNyh56uOb94wS?#vf(R@;$|zMB^q_D#G3%OocZr&XeeD&>33-+%nGR9FkEWxaQ)-ixqG;*M#8N?rJ+ zqJFHX`lUu#q7xgTFs?|QYFQ#+7uPf8mwTnwUBfhu9YV@w#eyh+v!E*N1d-`%`ixurR0gGtVZ5ujZX<7xdbG zw%BHVX(lX*cJoAD(HDMcT-0=~=v`9eiW<|iR}Oo6DOi%t(nzT_UagBL3^G2Fp;C|J z%4HyG>MI3JCAx99h>6%;y@kviYq%$tLv?j6)aIPNrk&>_d{ZAwVDDfASuicvYV*G4 zdus*KRR--YPPGEbmQ7Gsvj)L?<)#t2t%<3?sU#bwlv9mFaS?>a#ATC?@c1Yq*d_%eo!Wz#V{Z^FVl1>XdQwXnHGDnM&B8m`LKFFe#n zxKzBpR1`kJVGLCTdOyKo@g80UwF*7eK<#70VO_(^@UZ4B1;m=U3=wPI5=g9B{|rp5 zt*O7ziplk_1;tgbYFJ31q}tc+8pfJ0u%A$|{7U%=6`TJD|7TF~r9^B02Xy=g($V44 diff --git a/ext/standard/tests/array/array_values_errors.phpt b/ext/standard/tests/array/array_values_errors.phpt new file mode 100644 index 0000000000..d72d565cb0 --- /dev/null +++ b/ext/standard/tests/array/array_values_errors.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test array_values() function (errors) +--SKIPIF-- + +--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: array_values() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: array_values() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: array_values() expects parameter 1 to be array, string given in %s on line %d +NULL + +Warning: array_values() expects parameter 1 to be array, integer given in %s on line %d +NULL + +Warning: array_values() expects parameter 1 to be array, object given in %s on line %d +NULL +Done +--UEXPECTF-- +*** Testing error conditions *** + +Warning: array_values() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: array_values() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: array_values() expects parameter 1 to be array, Unicode string given in %s on line %d +NULL + +Warning: array_values() expects parameter 1 to be array, integer given in %s on line %d +NULL + +Warning: array_values() expects parameter 1 to be array, object given 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