Annotation of embedaddon/php/ext/date/tests/date_sunset_variation8.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test date_sunset() function : usage variation - Checking with North and South poles when Sun is up and down all day
3: --FILE--
4: <?php
5: /* Prototype : mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
6: * Description: Returns time of sunrise for a given day and location
7: * Source code: ext/date/php_date.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing date_sunset() : usage variation ***\n";
12:
13: // GMT is zero for the timezone
14: date_default_timezone_set("Africa/Casablanca");
15: $time_date = array (
16:
17: //Date at which Sun is up all day at North Pole
18: "12 Aug 2008" => mktime(8, 8, 8, 8, 12, 2008),
19: "13 Aug 2008" => mktime(8, 8, 8, 8, 13, 2008),
20:
21: //Date at which Sun is up all day at South Pole
22: "12 Nov 2008" => mktime(8, 8, 8, 11, 12, 2008),
23: "13 Nov 2008" => mktime(8, 8, 8, 11, 13, 2008),
24: );
25:
26: //Iterate over different date and time
27: foreach( $time_date as $date => $time ){
28: echo "\n--$date--\n";
29: var_dump( date_sunset($time, SUNFUNCS_RET_STRING, 90, 0 ) );
30: var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, 90, 0 ) );
31: var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, 90, 0 ) );
32: var_dump( date_sunset($time, SUNFUNCS_RET_STRING, -90, 0 ) );
33: var_dump( date_sunset($time, SUNFUNCS_RET_DOUBLE, -90, 0 ) );
34: var_dump( date_sunset($time, SUNFUNCS_RET_TIMESTAMP, -90, 0 ) );
35: }
36:
37: ?>
38: ===DONE===
39: --EXPECTF--
40: *** Testing date_sunset() : usage variation ***
41:
42: --12 Aug 2008--
43: bool(false)
44: bool(false)
45: bool(false)
46: bool(false)
47: bool(false)
48: bool(false)
49:
50: --13 Aug 2008--
51: bool(false)
52: bool(false)
53: bool(false)
54: bool(false)
55: bool(false)
56: bool(false)
57:
58: --12 Nov 2008--
59: bool(false)
60: bool(false)
61: bool(false)
62: bool(false)
63: bool(false)
64: bool(false)
65:
66: --13 Nov 2008--
67: bool(false)
68: bool(false)
69: bool(false)
70: bool(false)
71: bool(false)
72: bool(false)
73: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>