1--TEST--
2Test DateTime::modify() function : error conditions
3--FILE--
4<?php
5/* Prototype  : public DateTime DateTime::modify  ( string $modify  )
6 * Description: Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime().
7 * Source code: ext/date/php_date.c
8 * Alias to functions: public date_modify()
9 */
10
11//Set the default time zone
12date_default_timezone_set("Europe/London");
13
14echo "*** Testing DateTime::modify() : error conditions ***\n";
15
16// Create a date object
17$object = new DateTime("2009-01-30 19:34:10");
18
19echo "\n-- Testing DateTime::modify() function with less than expected no. of arguments --\n";
20var_dump( $object->modify() );
21
22echo "\n-- Testing DateTime::modify() function with more than expected no. of arguments --\n";
23$modify = "+1 day";
24$extra_arg = 99;
25var_dump( $object->modify($modify, $extra_arg) );
26
27?>
28===DONE===
29--EXPECTF--
30*** Testing DateTime::modify() : error conditions ***
31
32-- Testing DateTime::modify() function with less than expected no. of arguments --
33
34Warning: DateTime::modify() expects exactly 1 parameter, 0 given in %s on line %d
35bool(false)
36
37-- Testing DateTime::modify() function with more than expected no. of arguments --
38
39Warning: DateTime::modify() expects exactly 1 parameter, 2 given in %s on line %d
40bool(false)
41===DONE===
42
43