Annotation of embedaddon/php/ext/ereg/tests/sql_regcase_variation_001.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test sql_regcase() function : usage variations - unexpected arg type
3: --FILE--
4: <?php
5: /* Prototype : proto string sql_regcase(string string)
6: * Description: Make regular expression for case insensitive match
7: * Source code: ext/standard/reg.c
8: * Alias to functions: msql_regcase
9: */
10:
11: function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
12: echo "Error: $err_no - $err_msg, $filename($linenum)\n";
13: }
14: set_error_handler('test_error_handler');
15:
16: echo "*** Testing sql_regcase() : usage variations ***\n";
17:
18: // Initialise function arguments not being substituted (if any)
19:
20: //get an unset variable
21: $unset_var = 10;
22: unset ($unset_var);
23:
24: //array of values to iterate over
25: $values = array(
26:
27: // int data
28: 0,
29: 1,
30: 12345,
31: -2345,
32:
33: // float data
34: 10.5,
35: -10.5,
36: 10.1234567e10,
37: 10.7654321E-10,
38: .5,
39:
40: // array data
41: array(),
42: array(0),
43: array(1),
44: array(1, 2),
45: array('color' => 'red', 'item' => 'pen'),
46:
47: // null data
48: NULL,
49: null,
50:
51: // boolean data
52: true,
53: false,
54: TRUE,
55: FALSE,
56:
57: // empty data
58: "",
59: '',
60:
61: // object data
62: new stdclass(),
63:
64: // undefined data
65: $undefined_var,
66:
67: // unset data
68: $unset_var,
69: );
70:
71: // loop through each element of the array for string
72:
73: foreach($values as $value) {
74: echo "\nArg value $value \n";
75: var_dump( sql_regcase($value) );
76: };
77:
78: echo "Done";
79: ?>
80: --EXPECTF--
81: *** Testing sql_regcase() : usage variations ***
82: Error: 8 - Undefined variable: undefined_var, %s(62)
83: Error: 8 - Undefined variable: unset_var, %s(65)
84:
85: Arg value 0
86: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
87: string(1) "0"
88:
89: Arg value 1
90: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
91: string(1) "1"
92:
93: Arg value 12345
94: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
95: string(5) "12345"
96:
97: Arg value -2345
98: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
99: string(5) "-2345"
100:
101: Arg value 10.5
102: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
103: string(4) "10.5"
104:
105: Arg value -10.5
106: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
107: string(5) "-10.5"
108:
109: Arg value 101234567000
110: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
111: string(12) "101234567000"
112:
113: Arg value 1.07654321E-9
114: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
115: string(16) "1.07654321[Ee]-9"
116:
117: Arg value 0.5
118: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
119: string(3) "0.5"
120:
121: Arg value Array
122: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
123: Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72)
124: NULL
125:
126: Arg value Array
127: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
128: Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72)
129: NULL
130:
131: Arg value Array
132: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
133: Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72)
134: NULL
135:
136: Arg value Array
137: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
138: Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72)
139: NULL
140:
141: Arg value Array
142: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
143: Error: 2 - sql_regcase() expects parameter 1 to be string, array given, %s(72)
144: NULL
145:
146: Arg value
147: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
148: string(0) ""
149:
150: Arg value
151: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
152: string(0) ""
153:
154: Arg value 1
155: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
156: string(1) "1"
157:
158: Arg value
159: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
160: string(0) ""
161:
162: Arg value 1
163: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
164: string(1) "1"
165:
166: Arg value
167: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
168: string(0) ""
169:
170: Arg value
171: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
172: string(0) ""
173:
174: Arg value
175: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
176: string(0) ""
177: Error: 4096 - Object of class stdClass could not be converted to string, %s(71)
178:
179: Arg value
180: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
181: Error: 2 - sql_regcase() expects parameter 1 to be string, object given, %s(72)
182: NULL
183:
184: Arg value
185: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
186: string(0) ""
187:
188: Arg value
189: Error: 8192 - Function sql_regcase() is deprecated, %s(72)
190: string(0) ""
191: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>