1--TEST--
2IntlDateFormatter::formatObject(): error conditions
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))
6	die('skip intl extension not enabled');
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10ini_set("intl.default_locale", "pt_PT");
11ini_set("date.timezone", "Europe/Lisbon");
12
13var_dump(IntlDateFormatter::formatObject());
14var_dump(IntlDateFormatter::formatObject(1));
15var_dump(IntlDateFormatter::formatObject(new stdclass));
16
17class A extends IntlCalendar {function __construct(){}}
18var_dump(IntlDateFormatter::formatObject(new A));
19class B extends DateTime {function __construct(){}}
20var_dump(IntlDateFormatter::formatObject(new B));
21
22$cal = IntlCalendar::createInstance();
23var_dump(IntlDateFormatter::formatObject($cal, -2));
24var_dump(IntlDateFormatter::formatObject($cal, array()));
25var_dump(IntlDateFormatter::formatObject($cal, array(1,2,3)));
26var_dump(IntlDateFormatter::formatObject($cal, array(array(), 1)));
27var_dump(IntlDateFormatter::formatObject($cal, array(1, -2)));
28var_dump(IntlDateFormatter::formatObject($cal, ""));
29var_dump(IntlDateFormatter::formatObject($cal, "YYYY", array()));
30
31?>
32==DONE==
33--EXPECTF--
34Warning: IntlDateFormatter::formatObject() expects at least 1 parameter, 0 given in %s on line %d
35bool(false)
36
37Warning: IntlDateFormatter::formatObject() expects parameter 1 to be object, integer given in %s on line %d
38bool(false)
39
40Warning: IntlDateFormatter::formatObject(): datefmt_format_object: the passed object must be an instance of either IntlCalendar or DateTime in %s on line %d
41bool(false)
42
43Warning: IntlDateFormatter::formatObject(): datefmt_format_object: bad IntlCalendar instance: not initialized properly in %s on line %d
44bool(false)
45
46Warning: DateTime::getTimestamp(): The DateTime object has not been correctly initialized by its constructor in %s on line %d
47
48Warning: IntlDateFormatter::formatObject(): datefmt_format_object: error calling ::getTimeStamp() on the object in %s on line %d
49bool(false)
50
51Warning: IntlDateFormatter::formatObject(): datefmt_format_object: the date/time format type is invalid in %s on line %d
52bool(false)
53
54Warning: IntlDateFormatter::formatObject(): datefmt_format_object: bad format; if array, it must have two elements in %s on line %d
55bool(false)
56
57Warning: IntlDateFormatter::formatObject(): datefmt_format_object: bad format; if array, it must have two elements in %s on line %d
58bool(false)
59
60Warning: IntlDateFormatter::formatObject(): datefmt_format_object: bad format; the date format (first element of the array) is not valid in %s on line %d
61bool(false)
62
63Warning: IntlDateFormatter::formatObject(): datefmt_format_object: bad format; the time format (second element of the array) is not valid in %s on line %d
64bool(false)
65
66Warning: IntlDateFormatter::formatObject(): datefmt_format_object: the format is empty in %s on line %d
67bool(false)
68
69Warning: IntlDateFormatter::formatObject() expects parameter 3 to be string, array given in %s on line %d
70bool(false)
71==DONE==
72