diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-02-19 17:11:00 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-11 11:32:20 +0100 |
commit | 852485d8ecd784153e41e565a0a87abf99cf4e0d (patch) | |
tree | 3c8be88c2c98b5f1b2f9ea51e5d3a20c10baf3ff /Zend/tests/call_user_func_002.phpt | |
parent | 6bfb119e18e5241b6719a4ad69223d91c465a58e (diff) | |
download | php-git-852485d8ecd784153e41e565a0a87abf99cf4e0d.tar.gz |
Adjust tests for zpp TypeError change
Diffstat (limited to 'Zend/tests/call_user_func_002.phpt')
-rw-r--r-- | Zend/tests/call_user_func_002.phpt | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/Zend/tests/call_user_func_002.phpt b/Zend/tests/call_user_func_002.phpt index 454c6fda96..9d007a8af3 100644 --- a/Zend/tests/call_user_func_002.phpt +++ b/Zend/tests/call_user_func_002.phpt @@ -4,26 +4,38 @@ Testing call_user_func() with autoload and passing invalid params <?php spl_autoload_register(function ($class) { - var_dump($class); + var_dump($class); }); -call_user_func(array('foo', 'bar')); -call_user_func(array('', 'bar')); -call_user_func(array($foo, 'bar')); -call_user_func(array($foo, '')); +try { + call_user_func(array('foo', 'bar')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + call_user_func(array('', 'bar')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + call_user_func(array($foo, 'bar')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + call_user_func(array($foo, '')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> --EXPECTF-- string(3) "foo" - -Warning: call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, class '' not found in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found +call_user_func() expects parameter 1 to be a valid callback, class '' not found Notice: Undefined variable: foo in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object Notice: Undefined variable: foo in %s on line %d - -Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d +call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object |