I was using a binary with the new timelib. Undo the datetime tests
[hiphop-php.git] / hphp / test / zend / bad / ext-date / date_isodate_set_error.php
blob2398319f77239bf07eb61b0ea27c0c7f79d6937c
1 <?php
3 /* Prototype : DateTime date_isodate_set ( DateTime $object , int $year , int $week [, int $day ] )
4 * Description: Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
5 * Source code: ext/date/php_date.c
6 * Alias to functions: DateTime::setISODate
7 */
9 //Set the default time zone
10 date_default_timezone_set("Europe/London");
12 echo "*** Testing date_isodate_set() : error conditions ***\n";
14 echo "\n-- Testing date_isodate_set() function with zero arguments --\n";
15 var_dump( date_isodate_set() );
17 $datetime = date_create("2009-01-30 19:34:10");
18 echo "\n-- Testing date_isodate_set() function with less than expected no. of arguments --\n";
19 var_dump( date_isodate_set($datetime) );
21 echo "\n-- Testing date_isodate_set() function with more than expected no. of arguments --\n";
22 $year = 2009;
23 $week = 30;
24 $day = 7;
25 $extra_arg = 30;
26 var_dump( date_isodate_set($datetime, $year, $week, $day, $extra_arg) );
28 echo "\n-- Testing date_isodate_set() function with an invalid values for \$object argument --\n";
29 $invalid_obj = new stdClass();
30 var_dump( date_isodate_set($invalid_obj, $year, $week, $day) );
31 $invalid_obj = 10;
32 var_dump( date_isodate_set($invalid_obj, $year, $week, $day) );
33 $invalid_obj = null;
34 var_dump( date_isodate_set($invalid_obj, $year, $week, $day) );
36 ===DONE===