Annotation of embedaddon/php/ext/date/tests/date_sunrise_variation9.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test date_sunrise() function : usage variation - Passing high positive and negative float values to time argument.
3: --FILE--
4: <?php
5: /* Prototype : mixed date_sunrise(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_sunrise() : usage variation ***\n";
12:
13: // GMT is zero for the timezone
14: date_default_timezone_set("Asia/Calcutta");
15: //Initialise the variables
16: $latitude = 38.4;
17: $longitude = -9;
18: $zenith = 90;
19: $gmt_offset = 1;
20:
21: echo "\n-- Testing date_sunrise() function by passing float 12.3456789000e10 value to time --\n";
22: $time = 12.3456789000e10;
23: var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset) );
24: var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $gmt_offset) );
25: var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $gmt_offset) );
26:
27: echo "\n-- Testing date_sunrise() function by passing float -12.3456789000e10 value to time --\n";
28: $time = -12.3456789000e10;
29: var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset) );
30: var_dump( date_sunrise($time, SUNFUNCS_RET_DOUBLE, $latitude, $longitude, $zenith, $gmt_offset) );
31: var_dump( date_sunrise($time, SUNFUNCS_RET_TIMESTAMP, $latitude, $longitude, $zenith, $gmt_offset) );
32:
33: ?>
34: ===DONE===
35: --EXPECTREGEX--
36: \*\*\* Testing date_sunrise\(\) : usage variation \*\*\*
37:
38: -- Testing date_sunrise\(\) function by passing float 12.3456789000e10 value to time --
39: string\(5\) "(07:34|07:49)"
40: float\((7.566[0-9]*|7.821[0-9]*)\)
41: int\((-1097256359|123456811756)\)
42:
43: -- Testing date_sunrise\(\) function by passing float -12.3456789000e10 value to time --
44: string\(5\) "(07:42|08:48|08:04)"
45: float\((7.713[0-9]*|8.810[0-9]*|8.074[0-9]*)\)
46: int\((1097304168|-2147443882|-123456761731)\)
47: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>