Skip to content

Commit b9c5690

Browse files
committed
array test fixes
1 parent a16b7cb commit b9c5690

21 files changed

+44
-88
lines changed

ext/reflection/tests/ReflectionMethod_invoke_error1.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $testClassInstance->prop = "Hello";
3030
echo "invoke() on a non-object:\n";
3131
try {
3232
var_dump($foo->invoke(true));
33-
} catch (ReflectionException $e) {
33+
} catch (TypeError $e) {
3434
var_dump($e->getMessage());
3535
}
3636

@@ -59,9 +59,7 @@ try {
5959
?>
6060
--EXPECTF--
6161
invoke() on a non-object:
62-
63-
Warning: ReflectionMethod::invoke() expects parameter 1 to be object, bool given in %s%eReflectionMethod_invoke_error1.php on line %d
64-
NULL
62+
string(71) "ReflectionMethod::invoke() expects parameter 1 to be object, bool given"
6563

6664
invoke() on a non-instance:
6765
string(72) "Given object is not an instance of the class this method was declared in"

ext/sockets/tests/socket_sentto_recvfrom_ipv4_udp.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ if (!extension_loaded('sockets')) {
4343

4444
socket_close($socket);
4545
--EXPECT--
46+
bool(false)
4647
Received Ping! from remote address 127.0.0.1 and remote port 1223
4748
--CREDITS--
4849
Falko Menge <mail at falko-menge dot de>

ext/sockets/tests/socket_sentto_recvfrom_ipv6_udp.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ require 'ipv6_skipif.inc';
4545

4646
socket_close($socket);
4747
--EXPECT--
48+
bool(false)
4849
Received Ping! from remote address ::1 and remote port 1223
4950
--CREDITS--
5051
Falko Menge <mail at falko-menge dot de>

ext/standard/tests/array/array_diff_uassoc_error.phpt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ try {
4040

4141
// Testing array_diff_uassoc with one less than the expected number of arguments
4242
echo "\n-- Testing array_diff_uassoc() function with less than expected no. of arguments --\n";
43-
try {
44-
var_dump( array_diff_uassoc($array1, $array2) );
45-
} catch (TypeError $e) {
46-
echo $e->getMessage(), "\n";
47-
}
43+
var_dump( array_diff_uassoc($array1, $array2) );
4844

4945
?>
5046
===DONE===
@@ -57,6 +53,6 @@ array_diff_uassoc() expects parameter 6 to be a valid callback, array must have
5753

5854
-- Testing array_diff_uassoc() function with less than expected no. of arguments --
5955

60-
array_diff_uassoc(): at least 3 parameters are required, 2 given
61-
56+
Warning: array_diff_uassoc(): at least 3 parameters are required, 2 given in %s on line %d
57+
NULL
6258
===DONE===

ext/standard/tests/array/array_fill_keys.phpt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ basic array_fill_keys test
44
precision=14
55
--FILE--
66
<?php
7-
var_dump(array_fill_keys('test', 1));
87
var_dump(array_fill_keys(array(), 1));
98
var_dump(array_fill_keys(array('foo', 'bar'), NULL));
109
var_dump(array_fill_keys(array('5', 'foo', 10, 1.23), 123));
1110
var_dump(array_fill_keys(array('test', TRUE, 10, 100), ''));
1211
?>
13-
--EXPECTF--
14-
Warning: array_fill_keys() expects parameter 1 to be array, string given in %s on line %d
15-
NULL
12+
--EXPECT--
1613
array(0) {
1714
}
1815
array(2) {

ext/standard/tests/array/array_fill_keys_variation3.phpt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ array(2) {
3131
["two"]=>
3232
resource(%d) of type (stream)
3333
}
34-
3534
Done

ext/standard/tests/array/array_filter_variation10.phpt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,5 @@ array(2) {
9292
["b"]=>
9393
int(2)
9494
}
95-
96-
Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 48
97-
98-
Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 48
99-
100-
Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 48
101-
102-
Warning: is_numeric() expects exactly 1 parameter, 2 given in %s on line 48
103-
array(0) {
104-
}
95+
is_numeric() expects exactly 1 parameter, 2 given
10596
Done

ext/standard/tests/array/array_keys_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Test array_keys() function (error conditions)
33
--FILE--
44
<?php
55

6-
echo "\n*** Testing error conditions ***";
6+
echo "\n*** Testing error conditions ***\n";
77
try {
88
var_dump(array_keys(new stdclass)); // object
99
} catch (TypeError $e) {

ext/standard/tests/array/array_map_object1.phpt

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ class SimpleClass
2828
}
2929
function test($cb, $args) {
3030
echo join('::', $cb) . "\n";
31-
var_dump(array_map($cb, $args));
31+
try {
32+
var_dump(array_map($cb, $args));
33+
} catch (TypeError $e) {
34+
echo $e->getMessage(), "\n";
35+
}
3236
}
3337
test(array('SimpleClass', 'square'), array(1, 2));
3438

@@ -135,21 +139,15 @@ array(2) {
135139

136140
-- simple class with private variable and method --
137141
SimpleClassPri::add
138-
139-
Warning: array_map() expects parameter 1 to be a valid callback, cannot access private method SimpleClassPri::add() in %sarray_map_object1.php on line %d
140-
NULL
142+
array_map() expects parameter 1 to be a valid callback, cannot access private method SimpleClassPri::add()
141143

142144
-- simple class with protected variable and method --
143145
SimpleClassPro::mul
144-
145-
Warning: array_map() expects parameter 1 to be a valid callback, cannot access protected method SimpleClassPro::mul() in %sarray_map_object1.php on line %d
146-
NULL
146+
array_map() expects parameter 1 to be a valid callback, cannot access protected method SimpleClassPro::mul()
147147

148148
-- class without members --
149149
EmptyClass
150-
151-
Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in %sarray_map_object1.php on line %d
152-
NULL
150+
array_map() expects parameter 1 to be a valid callback, array must have exactly two members
153151

154152
-- abstract class --
155153
ChildClass::emptyFunction
@@ -182,13 +180,9 @@ array(2) {
182180
int(4)
183181
}
184182
StaticClass::cube
185-
186-
Warning: array_map() expects parameter 1 to be a valid callback, cannot access private method StaticClass::cube() in %sarray_map_object1.php on line %d
187-
NULL
183+
array_map() expects parameter 1 to be a valid callback, cannot access private method StaticClass::cube()
188184
StaticClass::retVal
189-
190-
Warning: array_map() expects parameter 1 to be a valid callback, cannot access protected method StaticClass::retVal() in %sarray_map_object1.php on line %d
191-
NULL
185+
array_map() expects parameter 1 to be a valid callback, cannot access protected method StaticClass::retVal()
192186
-- class implementing an interface --
193187
InterClass::square
194188
array(2) {

ext/standard/tests/array/array_map_variation12.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,5 @@ array(3) {
6262
NULL
6363
}
6464
-- with language construct --
65-
66-
Warning: array_map() expects parameter 1 to be a valid callback, function 'echo' not found or invalid function name in %s on line %d
67-
NULL
65+
array_map() expects parameter 1 to be a valid callback, function 'echo' not found or invalid function name
6866
Done

0 commit comments

Comments
 (0)