Return to array_uintersect_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test array_uintersect() function : error conditions 3: --FILE-- 4: <?php 5: /* Prototype : array array_uintersect(array arr1, array arr2 [, array ...], callback data_compare_func) 6: * Description: Returns the entries of arr1 that have values which are present in all the other arguments. Data is compared by using an user-supplied callback. 7: * Source code: ext/standard/array.c 8: * Alias to functions: 9: */ 10: 11: echo "*** Testing array_uintersect() : error conditions ***\n"; 12: 13: 14: //Test array_uintersect with one more than the expected number of arguments 15: echo "\n-- Testing array_uintersect() function with more than expected no. of arguments --\n"; 16: $arr1 = array(1, 2); 17: $arr2 = array(1, 2); 18: 19: include('compare_function.inc'); 20: $data_compare_function = 'compare_function'; 21: 22: $extra_arg = 10; 23: var_dump( array_uintersect($arr1, $arr2, $data_compare_function, $extra_arg) ); 24: 25: // Testing array_uintersect with one less than the expected number of arguments 26: echo "\n-- Testing array_uintersect() function with less than expected no. of arguments --\n"; 27: $arr1 = array(1, 2); 28: $arr2 = array(1, 2); 29: var_dump( array_uintersect($arr1, $arr2) ); 30: 31: ?> 32: ===DONE=== 33: --EXPECTF-- 34: *** Testing array_uintersect() : error conditions *** 35: 36: -- Testing array_uintersect() function with more than expected no. of arguments -- 37: 38: Warning: array_uintersect() expects parameter 4 to be a valid callback, no array or string given in %sarray_uintersect_error.php on line %d 39: NULL 40: 41: -- Testing array_uintersect() function with less than expected no. of arguments -- 42: 43: Warning: array_uintersect(): at least 3 parameters are required, 2 given in %sarray_uintersect_error.php on line %d 44: NULL 45: ===DONE===