Annotation of embedaddon/php/ext/date/tests/gmdate_variation12.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test gmdate() function : usage variation - Valid and invalid range of timestamp.
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : string gmdate(string format [, long timestamp])
                      6:  * Description: Format a GMT date/time 
                      7:  * Source code: ext/date/php_date.c
                      8:  * Alias to functions: 
                      9:  */
                     10: 
                     11: echo "*** Testing gmdate() : usage variation ***\n";
                     12: 
                     13: // Initialise all required variables
                     14: date_default_timezone_set('UTC');
                     15: 
                     16: $timestamp = mktime(20, 45, 54, 12, 13, 1901);
                     17: echo "\n-- Testing gmdate() function with minimum range of timestamp --\n";
                     18: var_dump( gmdate(DATE_ISO8601, $timestamp) );
                     19: 
                     20: $timestamp = mktime(20, 45, 50, 12, 13, 1901);
                     21: echo "\n-- Testing gmdate() function with less than the range of timestamp --\n";
                     22: var_dump( gmdate(DATE_ISO8601, $timestamp) );
                     23: 
                     24: echo "\n-- Testing gmdate() function with maximum range of timestamp --\n";
                     25: $timestamp = mktime(03, 14, 07, 1, 19, 2038);
                     26: var_dump( gmdate(DATE_ISO8601, $timestamp) );
                     27: 
                     28: echo "\n-- Testing gmdate() function with greater than the range of timestamp --\n";
                     29: $timestamp = mktime(03, 14, 10, 1, 19, 2038);
                     30: var_dump( gmdate(DATE_ISO8601, $timestamp) );
                     31: 
                     32: ?>
                     33: ===DONE===
                     34: --EXPECTREGEX--
                     35: \*\*\* Testing gmdate\(\) : usage variation \*\*\*
                     36: 
                     37: -- Testing gmdate\(\) function with minimum range of timestamp --
                     38: string\(24\) "1901-12-13T20:45:54\+0000"
                     39: 
                     40: -- Testing gmdate\(\) function with less than the range of timestamp --
                     41: string\(24\) "(1970-01-01T00:00:00\+0000|1901-12-13T20:45:50\+0000)"
                     42: 
                     43: -- Testing gmdate\(\) function with maximum range of timestamp --
                     44: string\(24\) "2038-01-19T03:14:07\+0000"
                     45: 
                     46: -- Testing gmdate\(\) function with greater than the range of timestamp --
                     47: string\(24\) "(1970-01-01T00:00:00\+0000|2038-01-19T03:14:10\+0000)"
                     48: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>