1--TEST--
2Test date_sunrise() function : error conditions
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 */
9
10echo "*** Testing date_sunrise() : error conditions ***\n";
11
12//Initialise the variables
13$time = time();
14$latitude = 38.4;
15$longitude = -9;
16$zenith = 90;
17$gmt_offset = 1;
18$extra_arg = 10;
19
20// Zero arguments
21echo "\n-- Testing date_sunrise() function with Zero arguments --\n";
22var_dump( date_sunrise() );
23
24//Test date_sunrise with one more than the expected number of arguments
25echo "\n-- Testing date_sunrise() function with more than expected no. of arguments --\n";
26var_dump( date_sunrise($time, SUNFUNCS_RET_STRING, $latitude, $longitude, $zenith, $gmt_offset, $extra_arg) );
27?>
28===DONE===
29--EXPECTF--
30*** Testing date_sunrise() : error conditions ***
31
32-- Testing date_sunrise() function with Zero arguments --
33
34Warning: date_sunrise() expects at least 1 parameter, 0 given in %s on line %d
35bool(false)
36
37-- Testing date_sunrise() function with more than expected no. of arguments --
38
39Warning: date_sunrise() expects at most 6 parameters, 7 given in %s on line %d
40bool(false)
41===DONE===
42