summaryrefslogtreecommitdiff
path: root/ext/intl/tests/calendar_isSet_error.phpt
blob: f1e3f67a2e1c06ff0c3f367995980d54e3914b60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
IntlCalendar::isSet(): bad arguments
--INI--
date.timezone=Atlantic/Azores
--SKIPIF--
<?php
if (!extension_loaded('intl'))
    die('skip intl extension not enabled');
--FILE--
<?php

$c = new IntlGregorianCalendar(NULL, 'pt_PT');

try {
    var_dump($c->isSet(-1));
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}

try {
    var_dump(intlcal_is_set(1, 2));
} catch (\TypeError $e) {
    echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
IntlCalendar::isSet(): Argument #1 ($field) must be a valid field
intlcal_is_set(): Argument #1 ($calendar) must be of type IntlCalendar, int given