1--TEST--
2IntlCalendar::get/Least/Greatest/Minimum/Maximum(): bad arguments
3--INI--
4date.timezone=Atlantic/Azores
5--SKIPIF--
6<?php
7if (!extension_loaded('intl'))
8    die('skip intl extension not enabled');
9--FILE--
10<?php
11
12$c = new IntlGregorianCalendar(NULL, 'pt_PT');
13
14try {
15    var_dump($c->getLeastMaximum(-1));
16} catch (Error $e) {
17    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
18}
19try {
20    var_dump($c->getMaximum(-1));
21} catch (Error $e) {
22    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
23}
24try {
25    var_dump($c->getGreatestMinimum(-1));
26} catch (Error $e) {
27    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
28}
29try {
30    var_dump($c->getMinimum(-1));
31} catch (Error $e) {
32    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
33}
34
35try {
36    var_dump(intlcal_get_least_maximum($c, -1));
37} catch (Error $e) {
38    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
39}
40try {
41    var_dump(intlcal_get_maximum($c, -1));
42} catch (Error $e) {
43    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
44}
45try {
46    var_dump(intlcal_get_greatest_minimum($c, -1));
47} catch (Error $e) {
48    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
49}
50try {
51    var_dump(intlcal_get_minimum($c, -1));
52} catch (Error $e) {
53    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
54}
55
56try {
57    var_dump(intlcal_get_least_maximum(1, 1));
58} catch (Error $e) {
59    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
60}
61try {
62    var_dump(intlcal_get_maximum(1, 1));
63} catch (Error $e) {
64    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
65}
66try {
67    var_dump(intlcal_get_greatest_minimum(1, -1));
68} catch (Error $e) {
69    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
70}
71try {
72    var_dump(intlcal_get_minimum(1, -1));
73} catch (Error $e) {
74    echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
75}
76?>
77--EXPECT--
78ValueError: 0, IntlCalendar::getLeastMaximum(): Argument #1 ($field) must be a valid field
79ValueError: 0, IntlCalendar::getMaximum(): Argument #1 ($field) must be a valid field
80ValueError: 0, IntlCalendar::getGreatestMinimum(): Argument #1 ($field) must be a valid field
81ValueError: 0, IntlCalendar::getMinimum(): Argument #1 ($field) must be a valid field
82ValueError: 0, intlcal_get_least_maximum(): Argument #2 ($field) must be a valid field
83ValueError: 0, intlcal_get_maximum(): Argument #2 ($field) must be a valid field
84ValueError: 0, intlcal_get_greatest_minimum(): Argument #2 ($field) must be a valid field
85ValueError: 0, intlcal_get_minimum(): Argument #2 ($field) must be a valid field
86TypeError: 0, intlcal_get_least_maximum(): Argument #1 ($calendar) must be of type IntlCalendar, int given
87TypeError: 0, intlcal_get_maximum(): Argument #1 ($calendar) must be of type IntlCalendar, int given
88TypeError: 0, intlcal_get_greatest_minimum(): Argument #1 ($calendar) must be of type IntlCalendar, int given
89TypeError: 0, intlcal_get_minimum(): Argument #1 ($calendar) must be of type IntlCalendar, int given
90