Skip to content

Commit 62c51fc

Browse files
committed
Adjust XFAIL tests due to TypeErrors
Closes GH-5152
1 parent 78f9f5e commit 62c51fc

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

Zend/tests/bug48770_2.phpt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,18 @@ class B extends A {
2424
public function func($str) {
2525
call_user_func_array(array($this, 'parent::func2'), array($str));
2626
call_user_func_array(array($this, 'parent::func3'), array($str));
27-
call_user_func_array(array($this, 'parent::func22'), array($str));
28-
call_user_func_array(array($this, 'parent::inexistent'), array($str));
27+
28+
try {
29+
call_user_func_array(array($this, 'parent::func22'), array($str));
30+
} catch (\TypeError $e) {
31+
echo $e->getMessage() . \PHP_EOL;
32+
}
33+
34+
try {
35+
call_user_func_array(array($this, 'parent::inexistent'), array($str));
36+
} catch (\TypeError $e) {
37+
echo $e->getMessage() . \PHP_EOL;
38+
}
2939
}
3040
private function func2($str) {
3141
var_dump(__METHOD__ .': '. $str);
@@ -45,10 +55,8 @@ $c = new C;
4555
$c->func('This should work!');
4656

4757
?>
48-
--EXPECTF--
58+
--EXPECT--
4959
string(27) "A::func2: This should work!"
5060
string(27) "A::func3: This should work!"
51-
52-
Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22() in %s on line %d
53-
54-
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'A' does not have a method 'inexistent' in %s on line %d
61+
call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22()
62+
call_user_func_array() expects parameter 1 to be a valid callback, class 'A' does not have a method 'inexistent'

Zend/tests/bug48770_3.phpt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ class B extends A {
2424
public function func($str) {
2525
call_user_func_array(array($this, 'self::func2'), array($str));
2626
call_user_func_array(array($this, 'self::func3'), array($str));
27-
call_user_func_array(array($this, 'self::inexistent'), array($str));
27+
28+
try {
29+
call_user_func_array(array($this, 'self::inexistent'), array($str));
30+
} catch (\TypeError $e) {
31+
echo $e->getMessage() . \PHP_EOL;
32+
}
2833
}
2934
private function func2($str) {
3035
var_dump(__METHOD__ .': '. $str);
@@ -44,8 +49,7 @@ $c = new C;
4449
$c->func('This should work!');
4550

4651
?>
47-
--EXPECTF--
52+
--EXPECT--
4853
string(27) "B::func2: This should work!"
4954
string(27) "B::func3: This should work!"
50-
51-
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent' in %s on line %d
55+
call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent'

0 commit comments

Comments
 (0)