Annotation of embedaddon/php/ext/date/tests/mktime_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test mktime() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : int mktime ([ int $hour= date("H") [, int $minute= date("i") [, int $second= date("s") [, int $month= date("n") [, int $day= date("j") [, int $year= date("Y") [, int $is_dst= -1 ]]]]]]] )
6: * Description: Get Unix timestamp for a date
7: * Source code: ext/date/php_date.c
8: * Alias to functions:
9: */
10: error_reporting(E_ALL | E_STRICT);
11:
12: //Set the default time zone
13: date_default_timezone_set("Europe/London");
14:
15: echo "*** Testing mktime() : error conditions ***\n";
16:
17: echo "\n-- Testing mktime() function with Zero arguments --\n";
18: var_dump( mktime() );
19:
20: echo "\n-- Testing mktime() function with more than expected no. of arguments --\n";
21: $hour = 10;
22: $minute = 30;
23: $sec = 45;
24: $month = 7;
25: $day = 2;
26: $year = 1963;
27: $is_dst = 0;
28: $extra_arg = 10;
29: var_dump( mktime($hour, $minute, $sec, $month, $day, $year, $is_dst, $extra_arg) );
30:
31: ?>
32: ===DONE===
33: --EXPECTF--
34: *** Testing mktime() : error conditions ***
35:
36: -- Testing mktime() function with Zero arguments --
37:
38: Strict Standards: mktime(): You should be using the time() function instead in %s on line %d
39: int(%d)
40:
41: -- Testing mktime() function with more than expected no. of arguments --
42:
43: Warning: mktime() expects at most 7 parameters, 8 given in %s on line %d
44: bool(false)
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>