Return to array_uintersect_assoc_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_assoc() function : error conditions 3: --FILE-- 4: <?php 5: /* Prototype : array array_uintersect_assoc(array arr1, array arr2 [, array ...], callback data_compare_func) 6: * Description: U 7: * Source code: ext/standard/array.c 8: * Alias to functions: 9: */ 10: 11: echo "*** Testing array_uintersect_assoc() : error conditions ***\n"; 12: 13: //Test array_uintersect_assoc with one more than the expected number of arguments 14: echo "\n-- Testing array_uintersect_assoc() function with more than expected no. of arguments --\n"; 15: $arr1 = array(1, 2); 16: $arr2 = array(1, 2); 17: include('compare_function.inc'); 18: $data_compare_function = 'compare_function'; 19: 20: $extra_arg = 10; 21: var_dump( array_uintersect_assoc($arr1, $arr2, $data_compare_function, $extra_arg) ); 22: 23: // Testing array_uintersect_assoc with one less than the expected number of arguments 24: echo "\n-- Testing array_uintersect_assoc() function with less than expected no. of arguments --\n"; 25: $arr1 = array(1, 2); 26: $arr2 = array(1, 2); 27: var_dump( array_uintersect_assoc($arr1, $arr2) ); 28: 29: ?> 30: ===DONE=== 31: --EXPECTF-- 32: *** Testing array_uintersect_assoc() : error conditions *** 33: 34: -- Testing array_uintersect_assoc() function with more than expected no. of arguments -- 35: 36: Warning: array_uintersect_assoc() expects parameter 4 to be a valid callback, no array or string given in %sarray_uintersect_assoc_error.php on line %d 37: NULL 38: 39: -- Testing array_uintersect_assoc() function with less than expected no. of arguments -- 40: 41: Warning: array_uintersect_assoc(): at least 3 parameters are required, 2 given in %sarray_uintersect_assoc_error.php on line %d 42: NULL 43: ===DONE===