Annotation of embedaddon/php/ext/date/tests/gmstrftime_variation13.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test gmstrftime() function : usage variation - Checking date related formats which are not supported on Windows.
3: --SKIPIF--
4: <?php
5: if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
6: die("skip Test is valid for Windows");
7: }
8: ?>
9: --FILE--
10: <?php
11: /* Prototype : string gmstrftime(string format [, int timestamp])
12: * Description: Format a GMT/UCT time/date according to locale settings
13: * Source code: ext/date/php_date.c
14: * Alias to functions:
15: */
16:
17: echo "*** Testing gmstrftime() : usage variation ***\n";
18:
19: // Initialise function arguments not being substituted (if any)
20: $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
21: setlocale(LC_ALL, "en_US");
22: date_default_timezone_set("Asia/Calcutta");
23:
24: //array of values to iterate over
25: $inputs = array(
26: 'Century number' => "%C",
27: 'Month Date Year' => "%D",
28: 'Year with century' => "%G",
29: 'Year without century' => "%g",
30: );
31:
32: // loop through each element of the array for timestamp
33:
34: foreach($inputs as $key =>$value) {
35: echo "\n--$key--\n";
36: var_dump( gmstrftime($value) );
37: var_dump( gmstrftime($value, $timestamp) );
38: };
39:
40: ?>
41: ===DONE===
42: --EXPECTF--
43: *** Testing gmstrftime() : usage variation ***
44:
45: --Century number--
46: bool(false)
47: bool(false)
48:
49: --Month Date Year--
50: bool(false)
51: bool(false)
52:
53: --Year with century--
54: bool(false)
55: bool(false)
56:
57: --Year without century--
58: bool(false)
59: bool(false)
60: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>