Annotation of embedaddon/php/ext/standard/tests/array/array_values_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test array_values() function : error conditions - Pass incorrect number of functions
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : array array_values(array $input)
! 6: * Description: Return just the values from the input array
! 7: * Source code: ext/standard/array.c
! 8: */
! 9:
! 10: /*
! 11: * Pass incorrect number of arguments to array_values to test behaviour
! 12: */
! 13:
! 14: echo "*** Testing array_values() : error conditions ***\n";
! 15:
! 16: // Zero arguments
! 17: echo "\n-- Testing array_values() function with Zero arguments --\n";
! 18: var_dump( array_values() );
! 19:
! 20: //Test array_values with one more than the expected number of arguments
! 21: echo "\n-- Testing array_values() function with more than expected no. of arguments --\n";
! 22: $input = array(1, 2);
! 23: $extra_arg = 10;
! 24: var_dump( array_values($input, $extra_arg) );
! 25:
! 26: echo "Done";
! 27: ?>
! 28:
! 29: --EXPECTF--
! 30: *** Testing array_values() : error conditions ***
! 31:
! 32: -- Testing array_values() function with Zero arguments --
! 33:
! 34: Warning: array_values() expects exactly 1 parameter, 0 given in %s on line %d
! 35: NULL
! 36:
! 37: -- Testing array_values() function with more than expected no. of arguments --
! 38:
! 39: Warning: array_values() expects exactly 1 parameter, 2 given in %s on line %d
! 40: NULL
! 41: Done
! 42:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>