Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions ext/intl/tests/breakiter_getPartsIterator_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $it = IntlBreakIterator::createWordInstance(NULL);
try {
var_dump($it->getPartsIterator(-1));
} catch(\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlBreakIterator::getPartsIterator(): Argument #1 ($type) must be one of IntlPartsIterator::KEY_SEQUENTIAL, IntlPartsIterator::KEY_LEFT, or IntlPartsIterator::KEY_RIGHT
ValueError: IntlBreakIterator::getPartsIterator(): Argument #1 ($type) must be one of IntlPartsIterator::KEY_SEQUENTIAL, IntlPartsIterator::KEY_LEFT, or IntlPartsIterator::KEY_RIGHT
6 changes: 3 additions & 3 deletions ext/intl/tests/bug48227.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ foreach (['', 1, NULL, $x] as $value) {
try {
var_dump($x->format($value));
} catch (TypeError $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
}

?>
--EXPECTF--
NumberFormatter::format(): Argument #1 ($num) must be of type int|float, string given
TypeError: NumberFormatter::format(): Argument #1 ($num) must be of type int|float, string given
string(1) "1"

Deprecated: NumberFormatter::format(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d
string(1) "0"
NumberFormatter::format(): Argument #1 ($num) must be of type int|float, NumberFormatter given
TypeError: NumberFormatter::format(): Argument #1 ($num) must be of type int|float, NumberFormatter given
8 changes: 4 additions & 4 deletions ext/intl/tests/bug61487.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ intl
try {
grapheme_stripos(1,1,2147483648);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}

try {
grapheme_strpos(1,1,2147483648);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
?>
--EXPECT--
grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
ValueError: grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
4 changes: 2 additions & 2 deletions ext/intl/tests/bug62083.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ $arr1 = array();
try {
grapheme_extract(-1, -1, -1,-1, $arr1);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
?>
--EXPECT--
grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS
ValueError: grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS
4 changes: 2 additions & 2 deletions ext/intl/tests/bug74063.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ $formatter = new NumberFormatter("en_GB", NumberFormatter::CURRENCY);
try {
serialize($formatter);
} catch (Exception $ex) {
echo $ex->getMessage(), PHP_EOL;
echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECT--
Serialization of 'NumberFormatter' is not allowed
Exception: Serialization of 'NumberFormatter' is not allowed
8 changes: 4 additions & 4 deletions ext/intl/tests/calendar_clear_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->clear(-1));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(intlcal_clear($c, -1));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlCalendar::clear(): Argument #1 ($field) must be a valid field
intlcal_clear(): Argument #2 ($field) must be a valid field
ValueError: IntlCalendar::clear(): Argument #1 ($field) must be a valid field
ValueError: intlcal_clear(): Argument #2 ($field) must be a valid field
4 changes: 2 additions & 2 deletions ext/intl/tests/calendar_createInstance_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ function __construct() {}
try {
intlcal_create_instance(new X, NULL);
} catch (IntlException $e) {
echo $e->getMessage();
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
intlcal_create_instance(): passed IntlTimeZone is not properly constructed
IntlException: intlcal_create_instance(): passed IntlTimeZone is not properly constructed
4 changes: 2 additions & 2 deletions ext/intl/tests/calendar_getDayOfWeekType_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->getDayOfWeekType(0));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlCalendar::getDayOfWeekType(): Argument #1 ($dayOfWeek) must be a valid day of the week
ValueError: IntlCalendar::getDayOfWeekType(): Argument #1 ($dayOfWeek) must be a valid day of the week
4 changes: 2 additions & 2 deletions ext/intl/tests/calendar_getWeekendTransition_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->getWeekendTransition(0));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlCalendar::getWeekendTransition(): Argument #1 ($dayOfWeek) must be a valid day of the week
ValueError: IntlCalendar::getWeekendTransition(): Argument #1 ($dayOfWeek) must be a valid day of the week
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,52 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->getLeastMaximum(-1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($c->getMaximum(-1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($c->getGreatestMinimum(-1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($c->getMinimum(-1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}

try {
var_dump(intlcal_get_least_maximum($c, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(intlcal_get_maximum($c, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(intlcal_get_greatest_minimum($c, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(intlcal_get_minimum($c, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
ValueError: 0, IntlCalendar::getLeastMaximum(): Argument #1 ($field) must be a valid field
ValueError: 0, IntlCalendar::getMaximum(): Argument #1 ($field) must be a valid field
ValueError: 0, IntlCalendar::getGreatestMinimum(): Argument #1 ($field) must be a valid field
ValueError: 0, IntlCalendar::getMinimum(): Argument #1 ($field) must be a valid field
ValueError: 0, intlcal_get_least_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_greatest_minimum(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_minimum(): Argument #2 ($field) must be a valid field
ValueError: 0: IntlCalendar::getLeastMaximum(): Argument #1 ($field) must be a valid field
ValueError: 0: IntlCalendar::getMaximum(): Argument #1 ($field) must be a valid field
ValueError: 0: IntlCalendar::getGreatestMinimum(): Argument #1 ($field) must be a valid field
ValueError: 0: IntlCalendar::getMinimum(): Argument #1 ($field) must be a valid field
ValueError: 0: intlcal_get_least_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0: intlcal_get_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0: intlcal_get_greatest_minimum(): Argument #2 ($field) must be a valid field
ValueError: 0: intlcal_get_minimum(): Argument #2 ($field) must be a valid field
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->get(-1));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($c->getActualMaximum(-1));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($c->getActualMinimum(-1));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlCalendar::get(): Argument #1 ($field) must be a valid field
IntlCalendar::getActualMaximum(): Argument #1 ($field) must be a valid field
IntlCalendar::getActualMinimum(): Argument #1 ($field) must be a valid field
ValueError: IntlCalendar::get(): Argument #1 ($field) must be a valid field
ValueError: IntlCalendar::getActualMaximum(): Argument #1 ($field) must be a valid field
ValueError: IntlCalendar::getActualMinimum(): Argument #1 ($field) must be a valid field
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump(intlcal_get($c, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(intlcal_get_actual_maximum($c, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(intlcal_get_actual_minimum($c, -1));
} catch (Error $e) {
echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
ValueError: 0, intlcal_get(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field
ValueError: 0: intlcal_get(): Argument #2 ($field) must be a valid field
ValueError: 0: intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field
ValueError: 0: intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field
4 changes: 2 additions & 2 deletions ext/intl/tests/calendar_isSet_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->isSet(-1));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlCalendar::isSet(): Argument #1 ($field) must be a valid field
ValueError: IntlCalendar::isSet(): Argument #1 ($field) must be a valid field
4 changes: 2 additions & 2 deletions ext/intl/tests/calendar_roll_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->roll(-1, 2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlCalendar::roll(): Argument #1 ($field) must be a valid field
ValueError: IntlCalendar::roll(): Argument #1 ($field) must be a valid field
8 changes: 4 additions & 4 deletions ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->setFirstDayOfWeek(0));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
var_dump(intlcal_set_first_day_of_week($c, 0));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $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
ValueError: IntlCalendar::setFirstDayOfWeek(): Argument #1 ($dayOfWeek) must be a valid day of the week
ValueError: intlcal_set_first_day_of_week(): Argument #2 ($dayOfWeek) must be a valid day of the week
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->setMinimalDaysInFirstWeek(0));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
var_dump(intlcal_set_minimal_days_in_first_week($c, 0));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlCalendar::setMinimalDaysInFirstWeek(): Argument #1 ($days) must be between 1 and 7
intlcal_set_minimal_days_in_first_week(): Argument #2 ($days) must be between 1 and 7
ValueError: IntlCalendar::setMinimalDaysInFirstWeek(): Argument #1 ($days) must be between 1 and 7
ValueError: intlcal_set_minimal_days_in_first_week(): Argument #2 ($days) must be between 1 and 7
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT');
try {
var_dump($c->setSkippedWallTimeOption(3));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump($c->setRepeatedWallTimeOption(2));
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

?>
--EXPECT--
IntlCalendar::setSkippedWallTimeOption(): Argument #1 ($option) must be one of IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST, or IntlCalendar::WALLTIME_NEXT_VALID
IntlCalendar::setRepeatedWallTimeOption(): Argument #1 ($option) must be either IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST
ValueError: IntlCalendar::setSkippedWallTimeOption(): Argument #1 ($option) must be one of IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST, or IntlCalendar::WALLTIME_NEXT_VALID
ValueError: IntlCalendar::setRepeatedWallTimeOption(): Argument #1 ($option) must be either IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST
12 changes: 6 additions & 6 deletions ext/intl/tests/calendar_set_date_out_of_bounds.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ $cal = IntlCalendar::createInstance();
try {
$cal->setDate(99999999999, 1, 1);
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
$cal->setDate(1, 99999999999, 1);
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}

try {
$cal->setDate(1, 1, 99999999999);
} catch (Throwable $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
IntlCalendar::setDate(): Argument #1 ($year) must be between -2147483648 and 2147483647
IntlCalendar::setDate(): Argument #2 ($month) must be between -2147483648 and 2147483647
IntlCalendar::setDate(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647
ValueError: IntlCalendar::setDate(): Argument #1 ($year) must be between -2147483648 and 2147483647
ValueError: IntlCalendar::setDate(): Argument #2 ($month) must be between -2147483648 and 2147483647
ValueError: IntlCalendar::setDate(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647
Loading
Loading