Annotation of embedaddon/php/ext/date/tests/idate_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test idate() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : int idate(string format [, int timestamp])
6: * Description: Format a local time/date as integer
7: * Source code: ext/date/php_date.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing idate() : error conditions ***\n";
12:
13: echo "\n-- Testing idate() function with Zero arguments --\n";
14: var_dump( idate() );
15:
16: echo "\n-- Testing idate() function with more than expected no. of arguments --\n";
17: $format = '%b %d %Y %H:%M:%S';
18: $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
19: $extra_arg = 10;
20: var_dump( idate($format, $timestamp, $extra_arg) );
21:
22: ?>
23: ===DONE===
24: --EXPECTF--
25: *** Testing idate() : error conditions ***
26:
27: -- Testing idate() function with Zero arguments --
28:
29: Warning: idate() expects at least 1 parameter, 0 given in %s on line %d
30: bool(false)
31:
32: -- Testing idate() function with more than expected no. of arguments --
33:
34: Warning: idate() expects at most 2 parameters, 3 given in %s on line %d
35: bool(false)
36: ===DONE===
37:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>