1--TEST--
2IntlCalendar::before()/after(): bad arguments
3--INI--
4date.timezone=Atlantic/Azores
5--EXTENSIONS--
6intl
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10
11$c = new IntlGregorianCalendar(NULL, 'pt_PT');
12
13function eh($errno, $errstr) {
14echo "error: $errno, $errstr\n";
15}
16set_error_handler('eh');
17
18try {
19    var_dump($c->after());
20} catch (Error $ex) {
21    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
22}
23try {
24    var_dump($c->before());
25} catch (Error $ex) {
26    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
27}
28
29try {
30    var_dump($c->after(1));
31} catch (Error $ex) {
32    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
33}
34try {
35    var_dump($c->before(1));
36} catch (Error $ex) {
37    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
38}
39
40try{
41    var_dump($c->after($c, 1));
42} catch (Error $ex) {
43    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
44}
45try {
46    var_dump($c->before($c, 1));
47} catch (Error $ex) {
48    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
49}
50
51try {
52    var_dump(intlcal_after($c));
53} catch (Error $ex) {
54    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
55}
56try {
57    var_dump(intlcal_before($c));
58} catch (Error $ex) {
59    echo "error: " . $ex->getCode() . ", " . $ex->getMessage() . "\n\n";
60}
61?>
62--EXPECT--
63error: 0, IntlCalendar::after() expects exactly 1 argument, 0 given
64
65error: 0, IntlCalendar::before() expects exactly 1 argument, 0 given
66
67error: 0, IntlCalendar::after(): Argument #1 ($other) must be of type IntlCalendar, int given
68
69error: 0, IntlCalendar::before(): Argument #1 ($other) must be of type IntlCalendar, int given
70
71error: 0, IntlCalendar::after() expects exactly 1 argument, 2 given
72
73error: 0, IntlCalendar::before() expects exactly 1 argument, 2 given
74
75error: 0, intlcal_after() expects exactly 2 arguments, 1 given
76
77error: 0, intlcal_before() expects exactly 2 arguments, 1 given
78