diff options
Diffstat (limited to 'ext/standard/tests/array/array_map_object2.phpt')
-rw-r--r-- | ext/standard/tests/array/array_map_object2.phpt | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ext/standard/tests/array/array_map_object2.phpt b/ext/standard/tests/array/array_map_object2.phpt index 7cfb528bf2..e5218ccbe4 100644 --- a/ext/standard/tests/array/array_map_object2.phpt +++ b/ext/standard/tests/array/array_map_object2.phpt @@ -26,21 +26,25 @@ class SimpleClass } echo "-- with non-existent class --\n"; -var_dump( array_map(array('non-existent', 'square'), array(1, 2)) ); +try { + var_dump( array_map(array('non-existent', 'square'), array(1, 2)) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "-- with existent class and non-existent method --\n"; -var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) ); +try { + var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} echo "Done"; ?> --EXPECTF-- *** Testing array_map() : with non-existent class and method *** -- with non-existent class -- - -Warning: array_map() expects parameter 1 to be a valid callback, class 'non-existent' not found in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, class 'non-existent' not found -- with existent class and non-existent method -- - -Warning: array_map() expects parameter 1 to be a valid callback, class 'SimpleClass' does not have a method 'non-existent' in %s on line %d -NULL +array_map() expects parameter 1 to be a valid callback, class 'SimpleClass' does not have a method 'non-existent' Done |