1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt
T
Nikita Popov c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00

36 lines
908 B
PHP

--TEST--
IntlCalendar::setFirstDayOfWeek(): 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->setFirstDayOfWeek(0));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_set_first_day_of_week($c, 0));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
}
try {
var_dump(intlcal_set_first_day_of_week(1, 2));
} catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
IntlCalendar::setFirstDayOfWeek(): Argument #1 ($dayOfWeek) must be a valid day of the week
intlcal_set_first_day_of_week(): Argument #2 ($dayOfWeek) must be a valid day of the week
intlcal_set_first_day_of_week(): Argument #1 ($calendar) must be of type IntlCalendar, int given