diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-31 10:35:07 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-05-31 10:52:06 +0200 |
commit | 4e391ee3a3086d4072012d5ed782517ed41ed400 (patch) | |
tree | dabe43dc2f97e047e0ef801fe066fea75dc8376e /ext/standard/tests/array/array_diff_ukey_variation1.phpt | |
parent | 4fff40e0d249423be5fe51aeedb0a23911f55bd2 (diff) | |
download | php-git-4e391ee3a3086d4072012d5ed782517ed41ed400.tar.gz |
Convert some warnings to TypeErrors in array functions
This is manual type and argument number checking code that was not
covered by the zpp move to TypeErrors.
Diffstat (limited to 'ext/standard/tests/array/array_diff_ukey_variation1.phpt')
-rw-r--r-- | ext/standard/tests/array/array_diff_ukey_variation1.phpt | 224 |
1 files changed, 64 insertions, 160 deletions
diff --git a/ext/standard/tests/array/array_diff_ukey_variation1.phpt b/ext/standard/tests/array/array_diff_ukey_variation1.phpt index bbf349c4fd..3b591018bd 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation1.phpt @@ -97,222 +97,126 @@ $inputs = array( // loop through each element of the array for arr1 foreach($inputs as $key =>$value) { - echo "\n--$key--\n"; - var_dump( array_diff_ukey($value, $array2, 'key_compare_func') ); - var_dump( array_diff_ukey($value, $array2, $array3, 'key_compare_func') ); + echo "\n--$key--\n"; + try { + var_dump( array_diff_ukey($value, $array2, 'key_compare_func') ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + try { + var_dump( array_diff_ukey($value, $array2, $array3, 'key_compare_func') ); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } }; fclose($fp); ?> ===DONE=== ---EXPECTF-- +--EXPECT-- *** Testing array_diff_ukey() : usage variation *** --int 0-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, int given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, int given in %s on line %d -NULL +Expected parameter 1 to be an array, int given +Expected parameter 1 to be an array, int given --int 1-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, int given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, int given in %s on line %d -NULL +Expected parameter 1 to be an array, int given +Expected parameter 1 to be an array, int given --int 12345-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, int given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, int given in %s on line %d -NULL +Expected parameter 1 to be an array, int given +Expected parameter 1 to be an array, int given --int -12345-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, int given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, int given in %s on line %d -NULL +Expected parameter 1 to be an array, int given +Expected parameter 1 to be an array, int given --float 10.5-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL +Expected parameter 1 to be an array, float given +Expected parameter 1 to be an array, float given --float -10.5-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL +Expected parameter 1 to be an array, float given +Expected parameter 1 to be an array, float given --float 12.3456789000e10-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL +Expected parameter 1 to be an array, float given +Expected parameter 1 to be an array, float given --float -12.3456789000e10-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL +Expected parameter 1 to be an array, float given +Expected parameter 1 to be an array, float given --float .5-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, float given in %s on line %d -NULL +Expected parameter 1 to be an array, float given +Expected parameter 1 to be an array, float given --uppercase NULL-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, null given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, null given in %s on line %d -NULL +Expected parameter 1 to be an array, null given +Expected parameter 1 to be an array, null given --lowercase null-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, null given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, null given in %s on line %d -NULL +Expected parameter 1 to be an array, null given +Expected parameter 1 to be an array, null given --lowercase true-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, bool given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, bool given in %s on line %d -NULL +Expected parameter 1 to be an array, bool given +Expected parameter 1 to be an array, bool given --lowercase false-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, bool given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, bool given in %s on line %d -NULL +Expected parameter 1 to be an array, bool given +Expected parameter 1 to be an array, bool given --uppercase TRUE-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, bool given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, bool given in %s on line %d -NULL +Expected parameter 1 to be an array, bool given +Expected parameter 1 to be an array, bool given --uppercase FALSE-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, bool given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, bool given in %s on line %d -NULL +Expected parameter 1 to be an array, bool given +Expected parameter 1 to be an array, bool given --empty string DQ-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL +Expected parameter 1 to be an array, string given +Expected parameter 1 to be an array, string given --empty string SQ-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL +Expected parameter 1 to be an array, string given +Expected parameter 1 to be an array, string given --string DQ-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL +Expected parameter 1 to be an array, string given +Expected parameter 1 to be an array, string given --string SQ-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL +Expected parameter 1 to be an array, string given +Expected parameter 1 to be an array, string given --mixed case string-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL +Expected parameter 1 to be an array, string given +Expected parameter 1 to be an array, string given --heredoc-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, string given in %s on line %d -NULL +Expected parameter 1 to be an array, string given +Expected parameter 1 to be an array, string given --instance of classWithToString-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, object given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, object given in %s on line %d -NULL +Expected parameter 1 to be an array, object given +Expected parameter 1 to be an array, object given --instance of classWithoutToString-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, object given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, object given in %s on line %d -NULL +Expected parameter 1 to be an array, object given +Expected parameter 1 to be an array, object given --undefined var-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, null given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, null given in %s on line %d -NULL +Expected parameter 1 to be an array, null given +Expected parameter 1 to be an array, null given --unset var-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, null given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, null given in %s on line %d -NULL +Expected parameter 1 to be an array, null given +Expected parameter 1 to be an array, null given --resource-- - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, resource given in %s on line %d -NULL - -Warning: array_diff_ukey(): Expected parameter 1 to be an array, resource given in %s on line %d -NULL +Expected parameter 1 to be an array, resource given +Expected parameter 1 to be an array, resource given ===DONE=== |