Commit 7334dcf5cc9 for php.net
commit 7334dcf5cc9cfd4f5cbf3e6bf34176da2f8498cc
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date: Sat Aug 1 18:05:24 2026 +0700
Applied fixers to improve test robustness (ext/intl, ext/phar) (#22985)
This commit hardens tests in the phar and intl extension. By:
- Testing exception type in error tests, and formating them consistently.
- Removing useless blank lines
diff --git a/ext/intl/tests/breakiter_getPartsIterator_error.phpt b/ext/intl/tests/breakiter_getPartsIterator_error.phpt
index f1a5c18c825..f14bdadb3e4 100644
--- a/ext/intl/tests/breakiter_getPartsIterator_error.phpt
+++ b/ext/intl/tests/breakiter_getPartsIterator_error.phpt
@@ -10,9 +10,9 @@
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
diff --git a/ext/intl/tests/bug48227.phpt b/ext/intl/tests/bug48227.phpt
index 8371a872eae..b9a9eddc228 100644
--- a/ext/intl/tests/bug48227.phpt
+++ b/ext/intl/tests/bug48227.phpt
@@ -10,15 +10,15 @@
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
diff --git a/ext/intl/tests/bug61487.phpt b/ext/intl/tests/bug61487.phpt
index c31738d29b9..f60b7fb15f2 100644
--- a/ext/intl/tests/bug61487.phpt
+++ b/ext/intl/tests/bug61487.phpt
@@ -10,15 +10,15 @@
try {
grapheme_stripos(1,1,2147483648);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
grapheme_strpos(1,1,2147483648);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--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)
diff --git a/ext/intl/tests/bug62083.phpt b/ext/intl/tests/bug62083.phpt
index cedab74d43a..4c46a74e425 100644
--- a/ext/intl/tests/bug62083.phpt
+++ b/ext/intl/tests/bug62083.phpt
@@ -8,8 +8,8 @@
try {
grapheme_extract(-1, -1, -1,-1, $arr1);
} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--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
diff --git a/ext/intl/tests/bug74063.phpt b/ext/intl/tests/bug74063.phpt
index b563dea4011..d7fa4e20788 100644
--- a/ext/intl/tests/bug74063.phpt
+++ b/ext/intl/tests/bug74063.phpt
@@ -8,8 +8,8 @@
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
diff --git a/ext/intl/tests/calendar_clear_error.phpt b/ext/intl/tests/calendar_clear_error.phpt
index 8f1695564e9..c1760ce6516 100644
--- a/ext/intl/tests/calendar_clear_error.phpt
+++ b/ext/intl/tests/calendar_clear_error.phpt
@@ -10,15 +10,15 @@
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
diff --git a/ext/intl/tests/calendar_createInstance_error.phpt b/ext/intl/tests/calendar_createInstance_error.phpt
index 28ade19b8fc..54e8c5afc92 100644
--- a/ext/intl/tests/calendar_createInstance_error.phpt
+++ b/ext/intl/tests/calendar_createInstance_error.phpt
@@ -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
diff --git a/ext/intl/tests/calendar_getDayOfWeekType_error.phpt b/ext/intl/tests/calendar_getDayOfWeekType_error.phpt
index fdea44c17fa..8725ca146be 100644
--- a/ext/intl/tests/calendar_getDayOfWeekType_error.phpt
+++ b/ext/intl/tests/calendar_getDayOfWeekType_error.phpt
@@ -9,9 +9,9 @@
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
diff --git a/ext/intl/tests/calendar_getWeekendTransition_error.phpt b/ext/intl/tests/calendar_getWeekendTransition_error.phpt
index a5e020a6803..bf15eae336d 100644
--- a/ext/intl/tests/calendar_getWeekendTransition_error.phpt
+++ b/ext/intl/tests/calendar_getWeekendTransition_error.phpt
@@ -10,9 +10,9 @@
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
diff --git a/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt b/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt
index 30365162820..23634db6bf9 100644
--- a/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt
+++ b/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt
@@ -10,52 +10,52 @@
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
diff --git a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt
index 475c0640222..908da9047c3 100644
--- a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt
+++ b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt
@@ -10,21 +10,21 @@
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
diff --git a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt
index 10eb7f8029b..0d87e2d1a75 100644
--- a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt
+++ b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt
@@ -10,21 +10,21 @@
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
diff --git a/ext/intl/tests/calendar_isSet_error.phpt b/ext/intl/tests/calendar_isSet_error.phpt
index 7f289f073ae..cde6efa7ea2 100644
--- a/ext/intl/tests/calendar_isSet_error.phpt
+++ b/ext/intl/tests/calendar_isSet_error.phpt
@@ -10,9 +10,9 @@
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
diff --git a/ext/intl/tests/calendar_roll_error.phpt b/ext/intl/tests/calendar_roll_error.phpt
index 4c05c17a5f8..cfad2e10d21 100644
--- a/ext/intl/tests/calendar_roll_error.phpt
+++ b/ext/intl/tests/calendar_roll_error.phpt
@@ -10,9 +10,9 @@
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
diff --git a/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt b/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt
index 6e85207f28d..d695b66282d 100644
--- a/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt
+++ b/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt
@@ -12,16 +12,16 @@
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
diff --git a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt
index dc3bbc9f3ac..fc66632da30 100644
--- a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt
+++ b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt
@@ -10,16 +10,16 @@
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
diff --git a/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt b/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt
index 8019c81870d..26faba5bc63 100644
--- a/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt
+++ b/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt
@@ -10,15 +10,15 @@
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
diff --git a/ext/intl/tests/calendar_set_date_out_of_bounds.phpt b/ext/intl/tests/calendar_set_date_out_of_bounds.phpt
index db9d18275ae..b63620e03a7 100644
--- a/ext/intl/tests/calendar_set_date_out_of_bounds.phpt
+++ b/ext/intl/tests/calendar_set_date_out_of_bounds.phpt
@@ -11,22 +11,22 @@
try {
$cal->setDate(99999999999, 1, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->setDate(1, 99999999999, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->setDate(1, 1, 99999999999);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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
diff --git a/ext/intl/tests/calendar_set_date_time_out_of_bounds.phpt b/ext/intl/tests/calendar_set_date_time_out_of_bounds.phpt
index 798ab1ebb01..6bfecc0d09b 100644
--- a/ext/intl/tests/calendar_set_date_time_out_of_bounds.phpt
+++ b/ext/intl/tests/calendar_set_date_time_out_of_bounds.phpt
@@ -11,43 +11,43 @@
try {
$cal->setDateTime(99999999999, 1, 1, 1, 1, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->setDateTime(1, 99999999999, 1, 1, 1, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->setDateTime(1, 1, 99999999999, 1, 1, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->setDateTime(1, 1, 1, 99999999999, 1, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->setDateTime(1, 1, 1, 1, 99999999999, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->setDateTime(1, 1, 1, 1, 1, 99999999999);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-IntlCalendar::setDateTime(): Argument #1 ($year) must be between -2147483648 and 2147483647
-IntlCalendar::setDateTime(): Argument #2 ($month) must be between -2147483648 and 2147483647
-IntlCalendar::setDateTime(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647
-IntlCalendar::setDateTime(): Argument #4 ($hour) must be between -2147483648 and 2147483647
-IntlCalendar::setDateTime(): Argument #5 ($minute) must be between -2147483648 and 2147483647
-IntlCalendar::setDateTime(): Argument #6 ($second) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::setDateTime(): Argument #1 ($year) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::setDateTime(): Argument #2 ($month) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::setDateTime(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::setDateTime(): Argument #4 ($hour) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::setDateTime(): Argument #5 ($minute) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::setDateTime(): Argument #6 ($second) must be between -2147483648 and 2147483647
diff --git a/ext/intl/tests/calendar_set_error.phpt b/ext/intl/tests/calendar_set_error.phpt
index d29442f5195..9a57eed2eb4 100644
--- a/ext/intl/tests/calendar_set_error.phpt
+++ b/ext/intl/tests/calendar_set_error.phpt
@@ -10,35 +10,35 @@
try {
$c->set(1, 2, 3, 4, 5, 6, 7);
} catch (ArgumentCountError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
$c->set(1, 2, 3, 4);
} catch (ArgumentCountError $exception) {
- echo $exception->getMessage() . "\n";
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump($c->set(-1, 2));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
var_dump(intlcal_set($c, -1, 2));
} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d
-IntlCalendar::set() expects at most 6 arguments, 7 given
+ArgumentCountError: IntlCalendar::set() expects at most 6 arguments, 7 given
Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d
-IntlCalendar::set() has no variant with exactly 4 parameters
-IntlCalendar::set(): Argument #1 ($year) must be a valid field
+ArgumentCountError: IntlCalendar::set() has no variant with exactly 4 parameters
+ValueError: IntlCalendar::set(): Argument #1 ($year) must be a valid field
Deprecated: Function intlcal_set() is deprecated since 8.4, use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead in %s on line %d
-intlcal_set(): Argument #2 ($year) must be a valid field
+ValueError: intlcal_set(): Argument #2 ($year) must be a valid field
diff --git a/ext/intl/tests/calendar_set_out_of_bounds.phpt b/ext/intl/tests/calendar_set_out_of_bounds.phpt
index 1ca407d3f71..be246dcaf3c 100644
--- a/ext/intl/tests/calendar_set_out_of_bounds.phpt
+++ b/ext/intl/tests/calendar_set_out_of_bounds.phpt
@@ -11,45 +11,45 @@
try {
$cal->set(99999999999, 1, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
intlcal_set($cal, 1, 99999999999, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->set(1, 1, 1, 99999999999, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$cal->set(1, 1, 1, 1, 99999999999, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
intlcal_set($cal, 1, 1, 1, 1, 1, 99999999999);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d
-IntlCalendar::set(): Argument #1 ($year) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::set(): Argument #1 ($year) must be between -2147483648 and 2147483647
Deprecated: Function intlcal_set() is deprecated since 8.4, use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead in %s on line %d
-intlcal_set(): Argument #3 ($month) must be between -2147483648 and 2147483647
+ValueError: intlcal_set(): Argument #3 ($month) must be between -2147483648 and 2147483647
Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d
-IntlCalendar::set(): Argument #4 ($hour) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::set(): Argument #4 ($hour) must be between -2147483648 and 2147483647
Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d
-IntlCalendar::set(): Argument #5 ($minute) must be between -2147483648 and 2147483647
+ValueError: IntlCalendar::set(): Argument #5 ($minute) must be between -2147483648 and 2147483647
Deprecated: Function intlcal_set() is deprecated since 8.4, use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead in %s on line %d
-intlcal_set(): Argument #7 ($second) must be between -2147483648 and 2147483647
+ValueError: intlcal_set(): Argument #7 ($second) must be between -2147483648 and 2147483647
diff --git a/ext/intl/tests/calendar_uninitialized_argument_position.phpt b/ext/intl/tests/calendar_uninitialized_argument_position.phpt
index f9236718054..115fecbfa47 100644
--- a/ext/intl/tests/calendar_uninitialized_argument_position.phpt
+++ b/ext/intl/tests/calendar_uninitialized_argument_position.phpt
@@ -12,7 +12,7 @@
try {
$calendar->$method($uninitialized);
} catch (Error $e) {
- echo $method, ': ', $e->getMessage(), PHP_EOL;
+ echo $method, ': ', $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
@@ -20,17 +20,17 @@
try {
$function($calendar, $uninitialized);
} catch (Error $e) {
- echo $function, ': ', $e->getMessage(), PHP_EOL;
+ echo $function, ': ', $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
?>
--EXPECT--
-equals: IntlCalendar::equals(): Argument #1 ($other) is uninitialized
-before: IntlCalendar::before(): Argument #1 ($other) is uninitialized
-after: IntlCalendar::after(): Argument #1 ($other) is uninitialized
-isEquivalentTo: IntlCalendar::isEquivalentTo(): Argument #1 ($other) is uninitialized
-intlcal_equals: intlcal_equals(): Argument #2 ($other) is uninitialized
-intlcal_before: intlcal_before(): Argument #2 ($other) is uninitialized
-intlcal_after: intlcal_after(): Argument #2 ($other) is uninitialized
-intlcal_is_equivalent_to: intlcal_is_equivalent_to(): Argument #2 ($other) is uninitialized
+equals: Error: IntlCalendar::equals(): Argument #1 ($other) is uninitialized
+before: Error: IntlCalendar::before(): Argument #1 ($other) is uninitialized
+after: Error: IntlCalendar::after(): Argument #1 ($other) is uninitialized
+isEquivalentTo: Error: IntlCalendar::isEquivalentTo(): Argument #1 ($other) is uninitialized
+intlcal_equals: Error: intlcal_equals(): Argument #2 ($other) is uninitialized
+intlcal_before: Error: intlcal_before(): Argument #2 ($other) is uninitialized
+intlcal_after: Error: intlcal_after(): Argument #2 ($other) is uninitialized
+intlcal_is_equivalent_to: Error: intlcal_is_equivalent_to(): Argument #2 ($other) is uninitialized
diff --git a/ext/intl/tests/collator_double_ctor.phpt b/ext/intl/tests/collator_double_ctor.phpt
index 93b72f7392b..f77642a9c87 100644
--- a/ext/intl/tests/collator_double_ctor.phpt
+++ b/ext/intl/tests/collator_double_ctor.phpt
@@ -9,8 +9,8 @@
try {
$collator->__construct('en_US');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Collator object is already constructed
+Error: Collator object is already constructed
diff --git a/ext/intl/tests/collator_sort_conversion_error_exception.phpt b/ext/intl/tests/collator_sort_conversion_error_exception.phpt
index c9a0e29694f..ea3f40ee883 100644
--- a/ext/intl/tests/collator_sort_conversion_error_exception.phpt
+++ b/ext/intl/tests/collator_sort_conversion_error_exception.phpt
@@ -19,7 +19,7 @@ public function __toString(): string {
$coll->sort($array, Collator::SORT_STRING);
echo 'no exception', PHP_EOL;
} catch (IntlException $e) {
- echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump($coll->getErrorCode() === U_INVALID_CHAR_FOUND);
var_dump($array[0], $array[1] instanceof BadString, $array[2]);
@@ -29,7 +29,7 @@ public function __toString(): string {
collator_asort($coll, $array, Collator::SORT_STRING);
echo 'no exception', PHP_EOL;
} catch (IntlException $e) {
- echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(array_keys($array));
?>
diff --git a/ext/intl/tests/collator_sort_tostring_throws.phpt b/ext/intl/tests/collator_sort_tostring_throws.phpt
index 309c641af2a..b3828dafbbd 100644
--- a/ext/intl/tests/collator_sort_tostring_throws.phpt
+++ b/ext/intl/tests/collator_sort_tostring_throws.phpt
@@ -24,7 +24,7 @@ function names(array $a): array {
try {
var_dump($coll->sort($array, $flag));
} catch (Throwable $e) {
- echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(names($array));
}
@@ -33,7 +33,7 @@ function names(array $a): array {
try {
var_dump($coll->sort($array, Collator::SORT_STRING));
} catch (Throwable $e) {
- echo get_class($e), ': ', $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
var_dump(names($array));
?>
diff --git a/ext/intl/tests/datefmt_parse_localtime_offset_type_error.phpt b/ext/intl/tests/datefmt_parse_localtime_offset_type_error.phpt
index 5c3d03cd4f6..adb45efad50 100644
--- a/ext/intl/tests/datefmt_parse_localtime_offset_type_error.phpt
+++ b/ext/intl/tests/datefmt_parse_localtime_offset_type_error.phpt
@@ -12,33 +12,33 @@
try {
$fmt->parse('America/Los_Angeles', $offset);
} catch (TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$offset = 'offset';
try {
datefmt_parse($fmt, 'America/Los_Angeles', $offset);
} catch (TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$offset = 'offset';
try {
$fmt->localtime('America/Los_Angeles', $offset);
} catch (TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$offset = 'offset';
try {
datefmt_localtime($fmt, 'America/Los_Angeles', $offset);
} catch (TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-IntlDateFormatter::parse(): Argument #2 ($offset) must be of type int, string given
-datefmt_parse(): Argument #3 ($offset) must be of type int, string given
-IntlDateFormatter::localtime(): Argument #2 ($offset) must be of type int, string given
-datefmt_localtime(): Argument #3 ($offset) must be of type int, string given
+TypeError: IntlDateFormatter::parse(): Argument #2 ($offset) must be of type int, string given
+TypeError: datefmt_parse(): Argument #3 ($offset) must be of type int, string given
+TypeError: IntlDateFormatter::localtime(): Argument #2 ($offset) must be of type int, string given
+TypeError: datefmt_localtime(): Argument #3 ($offset) must be of type int, string given
diff --git a/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt b/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt
index e33464a40a4..480074dbd82 100644
--- a/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt
+++ b/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt
@@ -25,4 +25,3 @@
IntlException: IntlDateFormatter::__construct(): No such time zone: "bad timezone"
IntlException: IntlDateFormatter::__construct(): Invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object
TypeError: IntlDateFormatter::__construct(): Argument #5 ($calendar) must be of type IntlCalendar|int|null, stdClass given
-
diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant_icu70.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant_icu70.phpt
index d34c93bfb36..b2b4cbf9030 100644
--- a/ext/intl/tests/dateformat_get_set_calendar_variant_icu70.phpt
+++ b/ext/intl/tests/dateformat_get_set_calendar_variant_icu70.phpt
@@ -52,4 +52,3 @@ function d(IntlDateFormatter $df) {
bool(false)
string(9) "gregorian"
string(3) "UTC"
-
diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant5.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant5.phpt
index 428e67fc24e..8c5d9c32961 100644
--- a/ext/intl/tests/dateformat_get_set_timezone_variant5.phpt
+++ b/ext/intl/tests/dateformat_get_set_timezone_variant5.phpt
@@ -55,4 +55,3 @@ function d(IntlDateFormatter $df) {
domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s padrão %Sda Europa Central
string(16) "Europe/Amsterdam"
string(16) "Europe/Amsterdam"
-
diff --git a/ext/intl/tests/dateformat_set_timezone_id_icu72-1.phpt b/ext/intl/tests/dateformat_set_timezone_id_icu72-1.phpt
index 6424ba1e6b4..c26327c1f9d 100644
--- a/ext/intl/tests/dateformat_set_timezone_id_icu72-1.phpt
+++ b/ext/intl/tests/dateformat_set_timezone_id_icu72-1.phpt
@@ -37,7 +37,7 @@ function ut_main()
try {
ut_datefmt_set_timezone_id( $fmt , $timezone_id_entry );
} catch (IntlException $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$timezone_id = ut_datefmt_get_timezone_id( $fmt );
$res_str .= "\nAfter call to set_timezone_id : timezone_id= $timezone_id";
diff --git a/ext/intl/tests/formatter_format_and_parse_errors.phpt b/ext/intl/tests/formatter_format_and_parse_errors.phpt
index e2d1cde8913..a99df84f724 100644
--- a/ext/intl/tests/formatter_format_and_parse_errors.phpt
+++ b/ext/intl/tests/formatter_format_and_parse_errors.phpt
@@ -13,61 +13,61 @@
try {
numfmt_format($o, $num, -20);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$o->format($num, -20);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
numfmt_parse($o, $str, -20);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$o->parse($str, -20);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
/* With NumberFormatter::TYPE_CURRENCY */
try {
numfmt_format($o, $num, NumberFormatter::TYPE_CURRENCY);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$o->format($num, NumberFormatter::TYPE_CURRENCY);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
numfmt_parse($o, $str, NumberFormatter::TYPE_CURRENCY);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$o->parse($str, NumberFormatter::TYPE_CURRENCY);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-numfmt_format(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant
-NumberFormatter::format(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant
-numfmt_parse(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant
-NumberFormatter::parse(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant
+ValueError: numfmt_format(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant
+ValueError: NumberFormatter::format(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant
+ValueError: numfmt_parse(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant
+ValueError: NumberFormatter::parse(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated since 8.3 in %s on line %d
-numfmt_format(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_format_currency() function instead
+ValueError: numfmt_format(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_format_currency() function instead
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated since 8.3 in %s on line %d
-NumberFormatter::format(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::formatCurrency() method instead
+ValueError: NumberFormatter::format(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::formatCurrency() method instead
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated since 8.3 in %s on line %d
-numfmt_parse(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_parse_currency() function instead
+ValueError: numfmt_parse(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_parse_currency() function instead
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated since 8.3 in %s on line %d
-NumberFormatter::parse(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::parseCurrency() method instead
+ValueError: NumberFormatter::parse(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::parseCurrency() method instead
diff --git a/ext/intl/tests/formatter_format_decimal_compact.phpt b/ext/intl/tests/formatter_format_decimal_compact.phpt
index 2c78f8787e0..cb2d88f1181 100644
--- a/ext/intl/tests/formatter_format_decimal_compact.phpt
+++ b/ext/intl/tests/formatter_format_decimal_compact.phpt
@@ -54,4 +54,4 @@ function ut_main()
en: short = 1.2M
en: long = 1.2 million
bg: short = 1,2 млн.
-bg: long = 1,2 милиона
\ No newline at end of file
+bg: long = 1,2 милиона
diff --git a/ext/intl/tests/gh12243.phpt b/ext/intl/tests/gh12243.phpt
index 324ed9a6566..b1b1014c5d8 100644
--- a/ext/intl/tests/gh12243.phpt
+++ b/ext/intl/tests/gh12243.phpt
@@ -16,9 +16,9 @@
timezone: $datetime->getTimezone(),
);
} catch (\IntlException $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-IntlDateFormatter::__construct(): datefmt_create: time format must be IntlDateFormatter::PATTERN if date format is IntlDateFormatter::PATTERN
+IntlException: IntlDateFormatter::__construct(): datefmt_create: time format must be IntlDateFormatter::PATTERN if date format is IntlDateFormatter::PATTERN
diff --git a/ext/intl/tests/gh12282.phpt b/ext/intl/tests/gh12282.phpt
index b12dc655f70..421e6abb188 100644
--- a/ext/intl/tests/gh12282.phpt
+++ b/ext/intl/tests/gh12282.phpt
@@ -15,15 +15,15 @@
'w'
);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
Locale::setDefault('xx');
try {
new IntlDateFormatter(Locale::getDefault());
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
--EXPECT--
-IntlDateFormatter::__construct(): Argument #1 ($locale) "xx" is invalid
-IntlDateFormatter::__construct(): Argument #1 ($locale) "xx" is invalid
+ValueError: IntlDateFormatter::__construct(): Argument #1 ($locale) "xx" is invalid
+ValueError: IntlDateFormatter::__construct(): Argument #1 ($locale) "xx" is invalid
diff --git a/ext/intl/tests/gh12727.phpt b/ext/intl/tests/gh12727.phpt
index e04b5eb26a1..61746a9374b 100644
--- a/ext/intl/tests/gh12727.phpt
+++ b/ext/intl/tests/gh12727.phpt
@@ -8,8 +8,8 @@
try {
new NumberFormatter('xx', NumberFormatter::DECIMAL);
} catch (ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-NumberFormatter::__construct(): Argument #1 ($locale) "%s" is invalid
+ValueError: NumberFormatter::__construct(): Argument #1 ($locale) "%s" is invalid
diff --git a/ext/intl/tests/gh13766.phpt b/ext/intl/tests/gh13766.phpt
index 9ed8d985de4..f9119c4abc0 100644
--- a/ext/intl/tests/gh13766.phpt
+++ b/ext/intl/tests/gh13766.phpt
@@ -17,19 +17,19 @@
try {
$oIntlDateFormatter->parseToCalendar('America/Los_Angeles', $offset3);
} catch (\TypeError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$offset3 = PHP_INT_MAX * 16;
try {
$oIntlDateFormatter->parseToCalendar('America/Los_Angeles', $offset3);
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
--EXPECTF--
int(%d)
string(13) "Europe/Berlin"
int(%d)
string(19) "America/Los_Angeles"
-IntlDateFormatter::parseToCalendar(): Argument #2 ($offset) must be of type int, string given
+TypeError: IntlDateFormatter::parseToCalendar(): Argument #2 ($offset) must be of type int, string given
Warning: The float %r(1\.4757395258967641E\+20|34359738352)%r is not representable as an int, cast occurred in %s on line %d
diff --git a/ext/intl/tests/gh17469.phpt b/ext/intl/tests/gh17469.phpt
index 5a226368442..13108a7a140 100644
--- a/ext/intl/tests/gh17469.phpt
+++ b/ext/intl/tests/gh17469.phpt
@@ -19,12 +19,12 @@
try {
UConverter::transcode("\x0a", 'nein!!', 'UTF-8');
} catch (IntlException $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
UConverter::transcode("\x0a", 'UTF-16BE', 'da!');
} catch (IntlException $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
@@ -33,5 +33,5 @@
Warning: UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR in %s on line %d
Warning: UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR in %s on line %d
-UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR
-UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR
+IntlException: UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR
+IntlException: UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR
diff --git a/ext/intl/tests/grapheme_levenshtein.phpt b/ext/intl/tests/grapheme_levenshtein.phpt
index 37978f42236..5c8bce5d5d5 100644
--- a/ext/intl/tests/grapheme_levenshtein.phpt
+++ b/ext/intl/tests/grapheme_levenshtein.phpt
@@ -74,19 +74,19 @@
try {
grapheme_levenshtein($nabe, $nabe_E0100, 0, 1, 1);
} catch (ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
grapheme_levenshtein($nabe, $nabe_E0100, 1, 0, 1);
} catch (ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
grapheme_levenshtein($nabe, $nabe_E0100, 1, 1, 0);
} catch (ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
echo "--- Invalid locales ---\n";
@@ -138,9 +138,9 @@
int(1)
int(0)
--- Corner case ---
-grapheme_levenshtein(): Argument #3 ($insertion_cost) must be greater than 0 and less than or equal to %d
-grapheme_levenshtein(): Argument #4 ($replacement_cost) must be greater than 0 and less than or equal to %d
-grapheme_levenshtein(): Argument #5 ($deletion_cost) must be greater than 0 and less than or equal to %d
+ValueError: grapheme_levenshtein(): Argument #3 ($insertion_cost) must be greater than 0 and less than or equal to %d
+ValueError: grapheme_levenshtein(): Argument #4 ($replacement_cost) must be greater than 0 and less than or equal to %d
+ValueError: grapheme_levenshtein(): Argument #5 ($deletion_cost) must be greater than 0 and less than or equal to %d
--- Invalid locales ---
bool(false)
int(%d)
diff --git a/ext/intl/tests/grapheme_out_of_bounds.phpt b/ext/intl/tests/grapheme_out_of_bounds.phpt
index 286cb68b7d3..0279a9d1ef7 100644
--- a/ext/intl/tests/grapheme_out_of_bounds.phpt
+++ b/ext/intl/tests/grapheme_out_of_bounds.phpt
@@ -38,42 +38,42 @@
try {
var_dump(grapheme_strpos("foo", "bar", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_stripos("foo", "bar", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strrpos("foo", "bar", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strripos("foo", "bar", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strpos("äöü", "bar", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_stripos("äöü", "bar", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strrpos("äöü", "bar", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strripos("äöü", "bar", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -81,42 +81,42 @@
try {
var_dump(grapheme_strpos("foo", "bar", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_stripos("foo", "bar", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strrpos("foo", "bar", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strripos("foo", "bar", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strpos("äöü", "bar", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_stripos("äöü", "bar", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strrpos("äöü", "bar", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strripos("äöü", "bar", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -124,42 +124,42 @@
try {
var_dump(grapheme_strpos("äöü", "", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_stripos("äöü", "", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strrpos("äöü", "", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strripos("äöü", "", 4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strpos("äöü", "", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_stripos("äöü", "", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strrpos("äöü", "", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(grapheme_strripos("äöü", "", -4));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -208,32 +208,32 @@
bool(false)
bool(false)
-grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: 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_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: 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_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: 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_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: 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_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
-grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: 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_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: 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_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
+ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
string(0) ""
string(3) "foo"
diff --git a/ext/intl/tests/gregoriancalendar___construct_error.phpt b/ext/intl/tests/gregoriancalendar___construct_error.phpt
index 6922b7cadd8..b8459ef5d10 100644
--- a/ext/intl/tests/gregoriancalendar___construct_error.phpt
+++ b/ext/intl/tests/gregoriancalendar___construct_error.phpt
@@ -8,49 +8,49 @@
try {
var_dump(intlgregcal_create_instance(1,2,3,4,5,6,7));
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(intlgregcal_create_instance(1,2,3,4,5,6,7,8));
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(intlgregcal_create_instance(1,2,3,4));
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(new IntlGregorianCalendar(1,2,NULL,4));
} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(new IntlGregorianCalendar(1,2,3,4,5,array()));
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$cal = new IntlGregorianCalendar();
try {
$cal->__construct();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-Too many arguments
+ArgumentCountError: Too many arguments
Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-Too many arguments
+ArgumentCountError: Too many arguments
Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-No variant with 4 arguments (excluding trailing NULLs)
+ArgumentCountError: No variant with 4 arguments (excluding trailing NULLs)
Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-No variant with 4 arguments (excluding trailing NULLs)
+ArgumentCountError: No variant with 4 arguments (excluding trailing NULLs)
Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-IntlGregorianCalendar::__construct(): Argument #6 ($second) must be of type int, array given
-IntlGregorianCalendar object is already constructed
+TypeError: IntlGregorianCalendar::__construct(): Argument #6 ($second) must be of type int, array given
+Error: IntlGregorianCalendar object is already constructed
diff --git a/ext/intl/tests/gregoriancalendar___construct_out_of_bounds.phpt b/ext/intl/tests/gregoriancalendar___construct_out_of_bounds.phpt
index 5b084b25d86..f2d2e2611bf 100644
--- a/ext/intl/tests/gregoriancalendar___construct_out_of_bounds.phpt
+++ b/ext/intl/tests/gregoriancalendar___construct_out_of_bounds.phpt
@@ -9,45 +9,45 @@
try {
new IntlGregorianCalendar(99999999999, 1, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
intlgregcal_create_instance(1, 99999999999, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new IntlGregorianCalendar(1, 1, 1, 99999999999, 1);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new IntlGregorianCalendar(1, 1, 1, 1, 99999999999);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
intlgregcal_create_instance(1, 1, 1, 1, 1, 99999999999);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-IntlGregorianCalendar::__construct(): Argument #1 ($timezoneOrYear) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::__construct(): Argument #1 ($timezoneOrYear) must be between -2147483648 and 2147483647
Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-intlgregcal_create_instance(): Argument #2 ($localeOrMonth) must be between -2147483648 and 2147483647
+ValueError: intlgregcal_create_instance(): Argument #2 ($localeOrMonth) must be between -2147483648 and 2147483647
Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-IntlGregorianCalendar::__construct(): Argument #4 ($hour) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::__construct(): Argument #4 ($hour) must be between -2147483648 and 2147483647
Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-IntlGregorianCalendar::__construct(): Argument #5 ($minute) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::__construct(): Argument #5 ($minute) must be between -2147483648 and 2147483647
Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d
-intlgregcal_create_instance(): Argument #6 ($second) must be between -2147483648 and 2147483647
+ValueError: intlgregcal_create_instance(): Argument #6 ($second) must be between -2147483648 and 2147483647
diff --git a/ext/intl/tests/gregoriancalendar_set_date_error.phpt b/ext/intl/tests/gregoriancalendar_set_date_error.phpt
index 154f598d8df..9c2c0da0361 100644
--- a/ext/intl/tests/gregoriancalendar_set_date_error.phpt
+++ b/ext/intl/tests/gregoriancalendar_set_date_error.phpt
@@ -9,23 +9,23 @@
try {
var_dump(IntlGregorianCalendar::createFromDate(99999999999, 1, 1));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(IntlGregorianCalendar::createFromDate(1, 99999999999, 1));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(IntlGregorianCalendar::createFromDate(1, 1, 99999999999));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-IntlGregorianCalendar::createFromDate(): Argument #1 ($year) must be between -2147483648 and 2147483647
-IntlGregorianCalendar::createFromDate(): Argument #2 ($month) must be between -2147483648 and 2147483647
-IntlGregorianCalendar::createFromDate(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDate(): Argument #1 ($year) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDate(): Argument #2 ($month) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDate(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647
diff --git a/ext/intl/tests/gregoriancalendar_set_date_time_error.phpt b/ext/intl/tests/gregoriancalendar_set_date_time_error.phpt
index 4fcfa4a1ffb..2d5a67aafc0 100644
--- a/ext/intl/tests/gregoriancalendar_set_date_time_error.phpt
+++ b/ext/intl/tests/gregoriancalendar_set_date_time_error.phpt
@@ -9,44 +9,44 @@
try {
var_dump(IntlGregorianCalendar::createFromDateTime(99999999999, 1, 1, 1, 1, 1));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(IntlGregorianCalendar::createFromDateTime(1, 99999999999, 1, 1, 1, 1));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(IntlGregorianCalendar::createFromDateTime(1, 1, 99999999999, 1, 1, 1));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(IntlGregorianCalendar::createFromDateTime(1, 1, 1, 99999999999, 1, 1));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(IntlGregorianCalendar::createFromDateTime(1, 1, 1, 1, 99999999999, 1));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(IntlGregorianCalendar::createFromDateTime(1, 1, 1, 1, 1, 99999999999));
} catch (ValueError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-IntlGregorianCalendar::createFromDateTime(): Argument #1 ($year) must be between -2147483648 and 2147483647
-IntlGregorianCalendar::createFromDateTime(): Argument #2 ($month) must be between -2147483648 and 2147483647
-IntlGregorianCalendar::createFromDateTime(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647
-IntlGregorianCalendar::createFromDateTime(): Argument #4 ($hour) must be between -2147483648 and 2147483647
-IntlGregorianCalendar::createFromDateTime(): Argument #5 ($minute) must be between -2147483648 and 2147483647
-IntlGregorianCalendar::createFromDateTime(): Argument #6 ($second) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #1 ($year) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #2 ($month) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #4 ($hour) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #5 ($minute) must be between -2147483648 and 2147483647
+ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #6 ($second) must be between -2147483648 and 2147483647
diff --git a/ext/intl/tests/ini_use_exceptions_basic.phpt b/ext/intl/tests/ini_use_exceptions_basic.phpt
index e03c991ae05..710da8ddc4e 100644
--- a/ext/intl/tests/ini_use_exceptions_basic.phpt
+++ b/ext/intl/tests/ini_use_exceptions_basic.phpt
@@ -9,14 +9,14 @@
try {
var_dump($t->transliterate('a', 3));
} catch (IntlException $intlE) {
- var_dump($intlE->getMessage());
+ echo $intlE::class, ': ', $intlE->getMessage(), "\n";
}
ini_set("intl.use_exceptions", false);
ini_set("intl.error_level", E_NOTICE);
var_dump($t->transliterate('a', 3));
?>
--EXPECTF--
-string(133) "Transliterator::transliterate(): Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 1)"
+IntlException: Transliterator::transliterate(): Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 1)
Deprecated: ini_set(): Using a value different than 0 for intl.error_level is deprecated, as the intl.error_level INI setting is deprecated. Instead the intl.use_exceptions INI setting should be enabled to throw exceptions on errors or intl_get_error_code()/intl_get_error_message() should be used to manually deal with errors in %s on line %d
diff --git a/ext/intl/tests/listformatter/listformatter_clone.phpt b/ext/intl/tests/listformatter/listformatter_clone.phpt
index ce7ce99aef4..e80fd4ff498 100644
--- a/ext/intl/tests/listformatter/listformatter_clone.phpt
+++ b/ext/intl/tests/listformatter/listformatter_clone.phpt
@@ -14,8 +14,8 @@
try {
$clonedFormatter = clone $formatter;
} catch(Error $error) {
- echo $error->getMessage();
+ echo $error::class, ': ', $error->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Trying to clone an uncloneable object of class IntlListFormatter
+Error: Trying to clone an uncloneable object of class IntlListFormatter
diff --git a/ext/intl/tests/listformatter/listformatter_double_ctor.phpt b/ext/intl/tests/listformatter/listformatter_double_ctor.phpt
index f8b0ca1e163..443326b5e54 100644
--- a/ext/intl/tests/listformatter/listformatter_double_ctor.phpt
+++ b/ext/intl/tests/listformatter/listformatter_double_ctor.phpt
@@ -9,8 +9,8 @@
try {
$formatter->__construct('en_US');
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-IntlListFormatter object is already constructed
+Error: IntlListFormatter object is already constructed
diff --git a/ext/intl/tests/listformatter/listformatter_error.phpt b/ext/intl/tests/listformatter/listformatter_error.phpt
index 4ca22136943..db065456d02 100644
--- a/ext/intl/tests/listformatter/listformatter_error.phpt
+++ b/ext/intl/tests/listformatter/listformatter_error.phpt
@@ -8,13 +8,13 @@
try {
$formatter = new IntlListFormatter('f', IntlListFormatter::TYPE_AND, IntlListFormatter::WIDTH_WIDE);
} catch(ValueError $exception) {
- echo $exception->getMessage() . PHP_EOL;
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
try {
$formatter = new IntlListFormatter('ro_thisiswaytooooooooooooooooooooooooooooooooooooooooooooolongtobevaliditneedstobeatleast157characterstofailthevalidationinthelistformattercodeimplementation', IntlListFormatter::TYPE_AND, IntlListFormatter::WIDTH_WIDE);
} catch(ValueError $exception) {
- echo $exception->getMessage() . PHP_EOL;
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
$formatter = new IntlListFormatter('ro', IntlListFormatter::TYPE_AND, IntlListFormatter::WIDTH_WIDE);
@@ -22,17 +22,17 @@
try {
echo $formatter->format([new stdClass()]);
} catch(Error $error) {
- echo $error->getMessage() . PHP_EOL;
+ echo $error::class, ': ', $error->getMessage(), PHP_EOL;
}
try {
echo $formatter->format([1, 2, new stdClass(), 4]);
} catch(Error $error) {
- echo $error->getMessage() . PHP_EOL;
+ echo $error::class, ': ', $error->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-IntlListFormatter::__construct(): Argument #1 ($locale) "f" is invalid
-IntlListFormatter::__construct(): Argument #1 ($locale) must be less than or equal to 156 characters
-Object of class stdClass could not be converted to string
-Object of class stdClass could not be converted to string
+ValueError: IntlListFormatter::__construct(): Argument #1 ($locale) "f" is invalid
+ValueError: IntlListFormatter::__construct(): Argument #1 ($locale) must be less than or equal to 156 characters
+Error: Object of class stdClass could not be converted to string
+Error: Object of class stdClass could not be converted to string
diff --git a/ext/intl/tests/listformatter/listformatter_with_parameters_error.phpt b/ext/intl/tests/listformatter/listformatter_with_parameters_error.phpt
index bfa75e7399b..1ae3ba6c8d1 100644
--- a/ext/intl/tests/listformatter/listformatter_with_parameters_error.phpt
+++ b/ext/intl/tests/listformatter/listformatter_with_parameters_error.phpt
@@ -10,17 +10,17 @@
try {
$formatter = new IntlListFormatter('ro', 23232323);
} catch(ValueError $exception) {
- echo $exception->getMessage();
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
-echo PHP_EOL;
+
try {
$formatter = new IntlListFormatter('ro', IntlListFormatter::TYPE_AND, 2323232);
} catch(ValueError $exception) {
- echo $exception->getMessage();
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-IntlListFormatter::__construct(): Argument #2 ($type) must be one of IntlListFormatter::TYPE_AND, IntlListFormatter::TYPE_OR, or IntlListFormatter::TYPE_UNITS
-IntlListFormatter::__construct(): Argument #3 ($width) must be one of IntlListFormatter::WIDTH_WIDE, IntlListFormatter::WIDTH_SHORT, or IntlListFormatter::WIDTH_NARROW
+ValueError: IntlListFormatter::__construct(): Argument #2 ($type) must be one of IntlListFormatter::TYPE_AND, IntlListFormatter::TYPE_OR, or IntlListFormatter::TYPE_UNITS
+ValueError: IntlListFormatter::__construct(): Argument #3 ($width) must be one of IntlListFormatter::WIDTH_WIDE, IntlListFormatter::WIDTH_SHORT, or IntlListFormatter::WIDTH_NARROW
diff --git a/ext/intl/tests/locale_filter_matches_icu70.phpt b/ext/intl/tests/locale_filter_matches_icu70.phpt
index 0e0b16af176..cc7cb0c302f 100644
--- a/ext/intl/tests/locale_filter_matches_icu70.phpt
+++ b/ext/intl/tests/locale_filter_matches_icu70.phpt
@@ -72,13 +72,13 @@ function ut_main()
try {
ut_loc_locale_filter_matches("de\0-DE", "de-DE", false);
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
ut_loc_locale_filter_matches("de-DE", "d\0e-DE", false);
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$res_str .= "\n";
@@ -91,10 +91,10 @@ function ut_main()
?>
--EXPECT--
-Locale::filterMatches(): Argument #1 ($languageTag) must not contain any null bytes
-Locale::filterMatches(): Argument #2 ($locale) must not contain any null bytes
-locale_filter_matches(): Argument #1 ($languageTag) must not contain any null bytes
-locale_filter_matches(): Argument #2 ($locale) must not contain any null bytes
+ValueError: Locale::filterMatches(): Argument #1 ($languageTag) must not contain any null bytes
+ValueError: Locale::filterMatches(): Argument #2 ($locale) must not contain any null bytes
+ValueError: locale_filter_matches(): Argument #1 ($languageTag) must not contain any null bytes
+ValueError: locale_filter_matches(): Argument #2 ($locale) must not contain any null bytes
--------------
loc_range:de-de matches lang_tag de-DEVA ? NO
loc_range:de_DE canonically matches lang_tag de_Deva ? NO
diff --git a/ext/intl/tests/locale_get_all_variants.phpt b/ext/intl/tests/locale_get_all_variants.phpt
index 12bf82cacac..ea2ebc432e0 100644
--- a/ext/intl/tests/locale_get_all_variants.phpt
+++ b/ext/intl/tests/locale_get_all_variants.phpt
@@ -42,7 +42,7 @@ function ut_main()
try {
ut_loc_locale_get_all_variants("i-\0tay");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$res_str .= "\n";
@@ -55,8 +55,8 @@ function ut_main()
?>
--EXPECT--
-Locale::getAllVariants(): Argument #1 ($locale) must not contain any null bytes
-locale_get_all_variants(): Argument #1 ($locale) must not contain any null bytes
+ValueError: Locale::getAllVariants(): Argument #1 ($locale) must not contain any null bytes
+ValueError: locale_get_all_variants(): Argument #1 ($locale) must not contain any null bytes
sl_IT_nedis_KIRTI : variants 'NEDIS','KIRTI',
sl_IT_nedis-a-kirti-x-xyz : variants 'NEDIS',
sl_IT_rozaj : variants 'ROZAJ',
diff --git a/ext/intl/tests/locale_get_display_keyword_null_bytes.phpt b/ext/intl/tests/locale_get_display_keyword_null_bytes.phpt
index fe83ac1b731..1f316787cd4 100644
--- a/ext/intl/tests/locale_get_display_keyword_null_bytes.phpt
+++ b/ext/intl/tests/locale_get_display_keyword_null_bytes.phpt
@@ -19,7 +19,7 @@ function ut_main()
try {
$call();
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
}
@@ -28,13 +28,13 @@ function ut_main()
ut_run();
?>
--EXPECT--
-Locale::getDisplayKeyword(): Argument #1 ($keyword) must not contain any null bytes
-Locale::getDisplayKeyword(): Argument #2 ($displayLocale) must not contain any null bytes
-Locale::getDisplayKeywordValue(): Argument #1 ($locale) must not contain any null bytes
-Locale::getDisplayKeywordValue(): Argument #2 ($keyword) must not contain any null bytes
-Locale::getDisplayKeywordValue(): Argument #3 ($displayLocale) must not contain any null bytes
-locale_get_display_keyword(): Argument #1 ($keyword) must not contain any null bytes
-locale_get_display_keyword(): Argument #2 ($displayLocale) must not contain any null bytes
-locale_get_display_keyword_value(): Argument #1 ($locale) must not contain any null bytes
-locale_get_display_keyword_value(): Argument #2 ($keyword) must not contain any null bytes
-locale_get_display_keyword_value(): Argument #3 ($displayLocale) must not contain any null bytes
+ValueError: Locale::getDisplayKeyword(): Argument #1 ($keyword) must not contain any null bytes
+ValueError: Locale::getDisplayKeyword(): Argument #2 ($displayLocale) must not contain any null bytes
+ValueError: Locale::getDisplayKeywordValue(): Argument #1 ($locale) must not contain any null bytes
+ValueError: Locale::getDisplayKeywordValue(): Argument #2 ($keyword) must not contain any null bytes
+ValueError: Locale::getDisplayKeywordValue(): Argument #3 ($displayLocale) must not contain any null bytes
+ValueError: locale_get_display_keyword(): Argument #1 ($keyword) must not contain any null bytes
+ValueError: locale_get_display_keyword(): Argument #2 ($displayLocale) must not contain any null bytes
+ValueError: locale_get_display_keyword_value(): Argument #1 ($locale) must not contain any null bytes
+ValueError: locale_get_display_keyword_value(): Argument #2 ($keyword) must not contain any null bytes
+ValueError: locale_get_display_keyword_value(): Argument #3 ($displayLocale) must not contain any null bytes
diff --git a/ext/intl/tests/locale_get_display_language4.phpt b/ext/intl/tests/locale_get_display_language4.phpt
index 1273c4a9996..bf3c7670935 100644
--- a/ext/intl/tests/locale_get_display_language4.phpt
+++ b/ext/intl/tests/locale_get_display_language4.phpt
@@ -10,20 +10,20 @@ function ut_main()
try {
ut_loc_get_display_language("a-D\0E", "locale=a-DE");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
ut_loc_get_display_language("a-DE", "locale=a\0-DE");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
}
include_once 'ut_common.inc';
ut_run();
?>
--EXPECT--
-Locale::getDisplayLanguage(): Argument #1 ($locale) must not contain any null bytes
-Locale::getDisplayLanguage(): Argument #2 ($displayLocale) must not contain any null bytes
-locale_get_display_language(): Argument #1 ($locale) must not contain any null bytes
-locale_get_display_language(): Argument #2 ($displayLocale) must not contain any null bytes
+ValueError: Locale::getDisplayLanguage(): Argument #1 ($locale) must not contain any null bytes
+ValueError: Locale::getDisplayLanguage(): Argument #2 ($displayLocale) must not contain any null bytes
+ValueError: locale_get_display_language(): Argument #1 ($locale) must not contain any null bytes
+ValueError: locale_get_display_language(): Argument #2 ($displayLocale) must not contain any null bytes
diff --git a/ext/intl/tests/locale_get_display_script4.phpt b/ext/intl/tests/locale_get_display_script4.phpt
index 53305293302..c26b67a8d98 100644
--- a/ext/intl/tests/locale_get_display_script4.phpt
+++ b/ext/intl/tests/locale_get_display_script4.phpt
@@ -86,13 +86,13 @@ function ut_main()
try {
ut_loc_get_display_script("a-D\0E", "locale=a-DE");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
ut_loc_get_display_script("a-DE", "locale=a\0-DE");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
return $res_str;
@@ -104,10 +104,10 @@ function ut_main()
?>
--EXPECT--
-Locale::getDisplayScript(): Argument #1 ($locale) must not contain any null bytes
-Locale::getDisplayScript(): Argument #2 ($displayLocale) must not contain any null bytes
-locale_get_display_script(): Argument #1 ($locale) must not contain any null bytes
-locale_get_display_script(): Argument #2 ($displayLocale) must not contain any null bytes
+ValueError: Locale::getDisplayScript(): Argument #1 ($locale) must not contain any null bytes
+ValueError: Locale::getDisplayScript(): Argument #2 ($displayLocale) must not contain any null bytes
+ValueError: locale_get_display_script(): Argument #1 ($locale) must not contain any null bytes
+ValueError: locale_get_display_script(): Argument #2 ($displayLocale) must not contain any null bytes
locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
disp_locale=en : display_script=
disp_locale=fr : display_script=
diff --git a/ext/intl/tests/locale_get_region.phpt b/ext/intl/tests/locale_get_region.phpt
index 0c3c1655deb..a6c26e89902 100644
--- a/ext/intl/tests/locale_get_region.phpt
+++ b/ext/intl/tests/locale_get_region.phpt
@@ -79,7 +79,7 @@ function ut_main()
try {
ut_loc_get_region("a-\0DE");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
return $res_str;
@@ -91,8 +91,8 @@ function ut_main()
?>
--EXPECTF--
-Locale::getRegion(): Argument #1 ($locale) must not contain any null bytes
-locale_get_region(): Argument #1 ($locale) must not contain any null bytes
+ValueError: Locale::getRegion(): Argument #1 ($locale) must not contain any null bytes
+ValueError: locale_get_region(): Argument #1 ($locale) must not contain any null bytes
uk-ua_CALIFORNIA@currency=;currency=GRN: region='UA'
root: region=''
uk@currency=EURO: region=''
diff --git a/ext/intl/tests/locale_get_script.phpt b/ext/intl/tests/locale_get_script.phpt
index 52e0a4155a9..efd67b2550e 100644
--- a/ext/intl/tests/locale_get_script.phpt
+++ b/ext/intl/tests/locale_get_script.phpt
@@ -77,7 +77,7 @@ function ut_main()
try {
ut_loc_get_script("de\0-419-DE");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
return $res_str;
@@ -89,8 +89,8 @@ function ut_main()
?>
--EXPECT--
-Locale::getScript(): Argument #1 ($locale) must not contain any null bytes
-locale_get_script(): Argument #1 ($locale) must not contain any null bytes
+ValueError: Locale::getScript(): Argument #1 ($locale) must not contain any null bytes
+ValueError: locale_get_script(): Argument #1 ($locale) must not contain any null bytes
uk-ua_CALIFORNIA@currency=;currency=GRN: script=''
root: script=''
uk@currency=EURO: script=''
diff --git a/ext/intl/tests/locale_is_right_to_left.phpt b/ext/intl/tests/locale_is_right_to_left.phpt
index c9e4323ff74..d1dfd1c50f6 100644
--- a/ext/intl/tests/locale_is_right_to_left.phpt
+++ b/ext/intl/tests/locale_is_right_to_left.phpt
@@ -11,7 +11,7 @@
try {
Locale::isRightToLeft("a\0r");
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
@@ -19,4 +19,4 @@
bool(false)
bool(false)
bool(true)
-Locale::isRightToLeft(): Argument #1 ($locale) must not contain any null bytes
+ValueError: Locale::isRightToLeft(): Argument #1 ($locale) must not contain any null bytes
diff --git a/ext/intl/tests/locale_lookup_invalid_language_tag.phpt b/ext/intl/tests/locale_lookup_invalid_language_tag.phpt
index 3ba48f61334..2891617e260 100644
--- a/ext/intl/tests/locale_lookup_invalid_language_tag.phpt
+++ b/ext/intl/tests/locale_lookup_invalid_language_tag.phpt
@@ -16,13 +16,13 @@
try {
Locale::lookup([''], 'de-DE', false, 'en-US');
} catch (IntlException $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
locale_lookup([''], 'de-DE', false, 'en-US');
} catch (IntlException $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -31,5 +31,5 @@
string(75) "Locale::lookup(): unable to canonicalize lang_tag: U_ILLEGAL_ARGUMENT_ERROR"
NULL
string(74) "locale_lookup(): unable to canonicalize lang_tag: U_ILLEGAL_ARGUMENT_ERROR"
-Locale::lookup(): unable to canonicalize lang_tag
-locale_lookup(): unable to canonicalize lang_tag
+IntlException: Locale::lookup(): unable to canonicalize lang_tag
+IntlException: locale_lookup(): unable to canonicalize lang_tag
diff --git a/ext/intl/tests/locale_lookup_variant3.phpt b/ext/intl/tests/locale_lookup_variant3.phpt
index b13a54139f4..b2f3d4af7bb 100644
--- a/ext/intl/tests/locale_lookup_variant3.phpt
+++ b/ext/intl/tests/locale_lookup_variant3.phpt
@@ -62,19 +62,19 @@ function ut_main()
try {
ut_loc_locale_lookup(["de\0-DE"], "de-DE", false, "en-US");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
ut_loc_locale_lookup(["de-DE"], "de-D\0E", true, "en-US");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
ut_loc_locale_lookup(["de-DE"], "de-DE", true, "e\0n-US");
} catch (\ValueError $e) {
- echo $e->getMessage(). PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
$res_str .= "\n";
@@ -87,12 +87,12 @@ function ut_main()
?>
--EXPECT--
-Locale::lookup(): Argument #2 ($locale) must not contain any null bytes
-Locale::lookup(): Argument #2 ($locale) must not contain any null bytes
-Locale::lookup(): Argument #4 ($defaultLocale) must not contain any null bytes
-locale_lookup(): Argument #2 ($locale) must not contain any null bytes
-locale_lookup(): Argument #2 ($locale) must not contain any null bytes
-locale_lookup(): Argument #4 ($defaultLocale) must not contain any null bytes
+ValueError: Locale::lookup(): Argument #2 ($locale) must not contain any null bytes
+ValueError: Locale::lookup(): Argument #2 ($locale) must not contain any null bytes
+ValueError: Locale::lookup(): Argument #4 ($defaultLocale) must not contain any null bytes
+ValueError: locale_lookup(): Argument #2 ($locale) must not contain any null bytes
+ValueError: locale_lookup(): Argument #2 ($locale) must not contain any null bytes
+ValueError: locale_lookup(): Argument #4 ($defaultLocale) must not contain any null bytes
--------------
loc_range:de-de
lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2
diff --git a/ext/intl/tests/locale_set_default.phpt b/ext/intl/tests/locale_set_default.phpt
index 6108f370274..c4aaf824bca 100644
--- a/ext/intl/tests/locale_set_default.phpt
+++ b/ext/intl/tests/locale_set_default.phpt
@@ -89,7 +89,7 @@ function ut_main()
try {
ut_loc_set_default("a-\0DE");
} catch (\ValueError $e) {
- echo $e->getMessage(), PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
return $res_str;
@@ -101,8 +101,8 @@ function ut_main()
?>
--EXPECT--
-Locale::setDefault(): Argument #1 ($locale) must not contain any null bytes
-locale_set_default(): Argument #1 ($locale) must not contain any null bytes
+ValueError: Locale::setDefault(): Argument #1 ($locale) must not contain any null bytes
+ValueError: locale_set_default(): Argument #1 ($locale) must not contain any null bytes
uk-ua_CALIFORNIA@currency=;currency=GRN: set locale 'uk-ua_CALIFORNIA@currency=;currency=GRN'
root: set locale 'root'
uk@currency=EURO: set locale 'uk@currency=EURO'
diff --git a/ext/intl/tests/msgfmt_bug70484.phpt b/ext/intl/tests/msgfmt_bug70484.phpt
index 91d34674364..9b5cfa19898 100644
--- a/ext/intl/tests/msgfmt_bug70484.phpt
+++ b/ext/intl/tests/msgfmt_bug70484.phpt
@@ -88,4 +88,3 @@
string(22) "2 147 483 643-other"
string(26) "2 147 483 643,123-other"
string(4) "five"
-
diff --git a/ext/intl/tests/numfmt_parse_currency_references.phpt b/ext/intl/tests/numfmt_parse_currency_references.phpt
index 06427a73693..76c8f534f9b 100644
--- a/ext/intl/tests/numfmt_parse_currency_references.phpt
+++ b/ext/intl/tests/numfmt_parse_currency_references.phpt
@@ -13,8 +13,8 @@ class Test {
try {
numfmt_parse_currency($fmt, $num, $test->prop);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign string to reference held by property Test::$prop of type int
+TypeError: Cannot assign string to reference held by property Test::$prop of type int
diff --git a/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt b/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt
index 83c993d7fc9..3cbaa02c85c 100644
--- a/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt
+++ b/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt
@@ -19,7 +19,7 @@
IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE
);
} catch (IntlException $exception) {
- echo $exception->getMessage() . PHP_EOL;
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
echo intl_get_error_code() . PHP_EOL;
@@ -28,7 +28,7 @@
try {
new IntlNumberRangeFormatter();
} catch(Error $error) {
- echo $error->getMessage() . PHP_EOL;
+ echo $error::class, ': ', $error->getMessage(), PHP_EOL;
}
try {
@@ -39,7 +39,7 @@
IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE
);
} catch (ValueError $exception) {
- echo $exception->getMessage() . PHP_EOL;
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
try {
@@ -50,7 +50,7 @@
343
);
} catch (ValueError $exception) {
- echo $exception->getMessage() . PHP_EOL;
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
try {
@@ -61,7 +61,7 @@
IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE
);
} catch (ValueError $exception) {
- echo $exception->getMessage() . PHP_EOL;
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
try {
@@ -72,16 +72,16 @@
IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE
);
} catch (ValueError $exception) {
- echo $exception->getMessage() . PHP_EOL;
+ echo $exception::class, ': ', $exception->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-IntlNumberRangeFormatter::createFromSkeleton(): Failed to create the number skeleton
+IntlException: IntlNumberRangeFormatter::createFromSkeleton(): Failed to create the number skeleton
65811
IntlNumberRangeFormatter::createFromSkeleton(): Failed to create the number skeleton: U_NUMBER_SKELETON_SYNTAX_ERROR
-Call to private IntlNumberRangeFormatter::__construct() from global scope
-IntlNumberRangeFormatter::createFromSkeleton(): Argument #3 ($collapse) must be one of IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, or IntlNumberRangeFormatter::COLLAPSE_ALL
-IntlNumberRangeFormatter::createFromSkeleton(): Argument #4 ($identityFallback) must be one of IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY, or IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE
-IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) "invalid-language" is invalid
-IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) must be no longer than 156 characters
+Error: Call to private IntlNumberRangeFormatter::__construct() from global scope
+ValueError: IntlNumberRangeFormatter::createFromSkeleton(): Argument #3 ($collapse) must be one of IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, or IntlNumberRangeFormatter::COLLAPSE_ALL
+ValueError: IntlNumberRangeFormatter::createFromSkeleton(): Argument #4 ($identityFallback) must be one of IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY, or IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE
+ValueError: IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) "invalid-language" is invalid
+ValueError: IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) must be no longer than 156 characters
diff --git a/ext/intl/tests/rbbiter___construct_basic.phpt b/ext/intl/tests/rbbiter___construct_basic.phpt
index e749442daa9..25f12c0a8db 100644
--- a/ext/intl/tests/rbbiter___construct_basic.phpt
+++ b/ext/intl/tests/rbbiter___construct_basic.phpt
@@ -26,10 +26,10 @@
try {
$obj = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+', 'aoeu');
} catch (IntlException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
string(26) "IntlRuleBasedBreakIterator"
-IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules
+IntlException: IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules
diff --git a/ext/intl/tests/resourcebundle_double_ctor.phpt b/ext/intl/tests/resourcebundle_double_ctor.phpt
index 331d3d503b0..a85fb8a3e23 100644
--- a/ext/intl/tests/resourcebundle_double_ctor.phpt
+++ b/ext/intl/tests/resourcebundle_double_ctor.phpt
@@ -10,9 +10,9 @@
try {
$r->__construct('en_US', BUNDLE);
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-ResourceBundle object is already constructed
+Error: ResourceBundle object is already constructed
diff --git a/ext/intl/tests/spoofchecker_008.phpt b/ext/intl/tests/spoofchecker_008.phpt
index 66e39967c78..3f6fd39777b 100644
--- a/ext/intl/tests/spoofchecker_008.phpt
+++ b/ext/intl/tests/spoofchecker_008.phpt
@@ -19,19 +19,19 @@
try {
$s->setAllowedChars('[a-z]', 1024);
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$s->setAllowedChars("A-Z]");
} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
try {
$s->setAllowedChars("[A-Z");
} catch (\ValueError $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -39,6 +39,6 @@
bool(true)
bool(false)
bool(false)
-Spoofchecker::setAllowedChars(): Argument #2 ($patternOptions) must be a valid pattern option, 0 or (SpoofChecker::IGNORE_SPACE|(<none> or SpoofChecker::CASE_INSENSITIVE%s))
-Spoofchecker::setAllowedChars(): Argument #1 ($pattern) must be a valid regular expression character set pattern
-Spoofchecker::setAllowedChars(): Argument #1 ($pattern) must be a valid regular expression character set pattern
+ValueError: Spoofchecker::setAllowedChars(): Argument #2 ($patternOptions) must be a valid pattern option, 0 or (SpoofChecker::IGNORE_SPACE|(<none> or SpoofChecker::CASE_INSENSITIVE%s))
+ValueError: Spoofchecker::setAllowedChars(): Argument #1 ($pattern) must be a valid regular expression character set pattern
+ValueError: Spoofchecker::setAllowedChars(): Argument #1 ($pattern) must be a valid regular expression character set pattern
diff --git a/ext/intl/tests/spoofchecker_double_ctor.phpt b/ext/intl/tests/spoofchecker_double_ctor.phpt
index 01dae5ab4bc..138a9cbffbb 100644
--- a/ext/intl/tests/spoofchecker_double_ctor.phpt
+++ b/ext/intl/tests/spoofchecker_double_ctor.phpt
@@ -11,8 +11,8 @@
try {
$checker->__construct();
} catch (Error $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Spoofchecker object is already constructed
+Error: Spoofchecker object is already constructed
diff --git a/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt b/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt
index 187be350f59..f3078e8969f 100644
--- a/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt
+++ b/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt
@@ -13,9 +13,9 @@
try {
$x->setRestrictionLevel(Spoofchecker::SINGLE_SCRIPT);
} catch (\ValueError $e) {
- echo $e->getMessage(), \PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-Spoofchecker::setRestrictionLevel(): Argument #1 ($level) must be one of Spoofchecker::ASCII, Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE, Spoofchecker::HIGHLY_RESTRICTIVE, Spoofchecker::MODERATELY_RESTRICTIVE, Spoofchecker::MINIMALLY_RESTRICTIVE, or Spoofchecker::UNRESTRICTIVE
+ValueError: Spoofchecker::setRestrictionLevel(): Argument #1 ($level) must be one of Spoofchecker::ASCII, Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE, Spoofchecker::HIGHLY_RESTRICTIVE, Spoofchecker::MODERATELY_RESTRICTIVE, Spoofchecker::MINIMALLY_RESTRICTIVE, or Spoofchecker::UNRESTRICTIVE
diff --git a/ext/phar/tests/002.phpt b/ext/phar/tests/002.phpt
index c89f223b2b9..793276d07cb 100644
--- a/ext/phar/tests/002.phpt
+++ b/ext/phar/tests/002.phpt
@@ -7,15 +7,15 @@
try {
Phar::mapPhar(5, 'hio', 'hi');
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::mapPhar();
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
__HALT_COMPILER(); ?>
--EXPECTF--
-Phar::mapPhar() expects at most 2 arguments, 3 given
-internal corruption of phar "%s002.php" (truncated manifest at manifest length)
+ArgumentCountError: Phar::mapPhar() expects at most 2 arguments, 3 given
+PharException: internal corruption of phar "%s002.php" (truncated manifest at manifest length)
diff --git a/ext/phar/tests/004.phpt b/ext/phar/tests/004.phpt
index 90d4572f071..ffa73318ec3 100644
--- a/ext/phar/tests/004.phpt
+++ b/ext/phar/tests/004.phpt
@@ -7,8 +7,8 @@
try {
Phar::mapPhar('hio');
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
-__HALT_COMPILER(); must be declared in a phar
+PharException: __HALT_COMPILER(); must be declared in a phar
diff --git a/ext/phar/tests/005.phpt b/ext/phar/tests/005.phpt
index 6bc2985f9f9..3119e4c3bcd 100644
--- a/ext/phar/tests/005.phpt
+++ b/ext/phar/tests/005.phpt
@@ -7,8 +7,8 @@
try {
Phar::mapPhar('hio');
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
__HALT_COMPILER(); ?>()
--EXPECTF--
-internal corruption of phar "%s" (truncated manifest at manifest length)
+PharException: internal corruption of phar "%s" (truncated manifest at manifest length)
diff --git a/ext/phar/tests/006.phpt b/ext/phar/tests/006.phpt
index e203bff90e7..db01fa53736 100644
--- a/ext/phar/tests/006.phpt
+++ b/ext/phar/tests/006.phpt
@@ -7,8 +7,8 @@
try {
Phar::mapPhar('hio');
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
__HALT_COMPILER(); ?>
--EXPECTF--
-internal corruption of phar "%s" (truncated manifest at manifest length)
+PharException: internal corruption of phar "%s" (truncated manifest at manifest length)
diff --git a/ext/phar/tests/007.phpt b/ext/phar/tests/007.phpt
index 701e6ccf08e..1e62b12ae03 100644
--- a/ext/phar/tests/007.phpt
+++ b/ext/phar/tests/007.phpt
@@ -7,8 +7,8 @@
try {
Phar::mapPhar('hio');
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
__HALT_COMPILER(); ?>~~~~
--EXPECTF--
-manifest cannot be larger than 100 MB in phar "%s"
+PharException: manifest cannot be larger than 100 MB in phar "%s"
diff --git a/ext/phar/tests/008.phpt b/ext/phar/tests/008.phpt
index a8e7eaec39e..00a211c5424 100644
--- a/ext/phar/tests/008.phpt
+++ b/ext/phar/tests/008.phpt
@@ -12,10 +12,10 @@
try {
include __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
-internal corruption of phar "%s" (truncated manifest header)
+PharException: internal corruption of phar "%s" (truncated manifest header)
diff --git a/ext/phar/tests/009.phpt b/ext/phar/tests/009.phpt
index d18329395a6..1e268b0a1f7 100644
--- a/ext/phar/tests/009.phpt
+++ b/ext/phar/tests/009.phpt
@@ -14,10 +14,10 @@
try {
include __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
-internal corruption of phar "%s009.phar.php" (too many manifest entries for size of manifest)
+PharException: internal corruption of phar "%s009.phar.php" (too many manifest entries for size of manifest)
diff --git a/ext/phar/tests/010.phpt b/ext/phar/tests/010.phpt
index 724d67d815d..4c91ffbc966 100644
--- a/ext/phar/tests/010.phpt
+++ b/ext/phar/tests/010.phpt
@@ -20,10 +20,10 @@
include __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
echo file_get_contents('phar://hio/a');
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
-internal corruption of phar "%s" (too many manifest entries for size of manifest)
+PharException: internal corruption of phar "%s" (too many manifest entries for size of manifest)
diff --git a/ext/phar/tests/011.phpt b/ext/phar/tests/011.phpt
index d143bd5091a..cb3c3e53584 100644
--- a/ext/phar/tests/011.phpt
+++ b/ext/phar/tests/011.phpt
@@ -21,10 +21,10 @@
include $fname;
echo file_get_contents('phar://hio/a');
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
-internal corruption of phar "%s" (compressed and uncompressed size does not match for uncompressed entry)
+PharException: internal corruption of phar "%s" (compressed and uncompressed size does not match for uncompressed entry)
diff --git a/ext/phar/tests/029.phpt b/ext/phar/tests/029.phpt
index 1b664fbdb74..ff1742d7253 100644
--- a/ext/phar/tests/029.phpt
+++ b/ext/phar/tests/029.phpt
@@ -33,7 +33,7 @@
}
catch (Exception $e)
{
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -45,4 +45,4 @@
--EXPECTF--
bool(true)
bool(true)
-alias "copy" is already used for archive "%s029.1.phar.php" cannot be overloaded with "%s029.2.phar.php"
+PharException: alias "copy" is already used for archive "%s029.1.phar.php" cannot be overloaded with "%s029.2.phar.php"
diff --git a/ext/phar/tests/030.phpt b/ext/phar/tests/030.phpt
index e558261df89..b5640a6eb6d 100644
--- a/ext/phar/tests/030.phpt
+++ b/ext/phar/tests/030.phpt
@@ -29,7 +29,7 @@
try {
$p['.phar/test'];
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -43,4 +43,4 @@
This is b/d
This is e
bool(false)
-Cannot directly get any files or directories in magic ".phar" directory
+BadMethodCallException: Cannot directly get any files or directories in magic ".phar" directory
diff --git a/ext/phar/tests/032.phpt b/ext/phar/tests/032.phpt
index 7099320e891..f813f43afd3 100644
--- a/ext/phar/tests/032.phpt
+++ b/ext/phar/tests/032.phpt
@@ -14,7 +14,7 @@
try {
Phar::loadPhar($fname);
} catch (Exception $e) {
-echo $e->getMessage();
+echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
@@ -25,4 +25,5 @@
__halt_compiler();
?>
--EXPECTF--
-phar "%s032.phar.php" does not have a signature===DONE===
+PharException: phar "%s032.phar.php" does not have a signature
+===DONE===
diff --git a/ext/phar/tests/033a.phpt b/ext/phar/tests/033a.phpt
index 355617b29f9..ba7df5cc442 100644
--- a/ext/phar/tests/033a.phpt
+++ b/ext/phar/tests/033a.phpt
@@ -28,7 +28,7 @@
$a['a.php']->chmod(0666);
var_dump($a['a.php']->isExecutable());
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -37,4 +37,4 @@
?>
--EXPECTF--
bool(false)
-Cannot modify permissions for file "a.php" in phar "%s033a.1.phar.php", write operations are prohibited
+PharException: Cannot modify permissions for file "a.php" in phar "%s033a.1.phar.php", write operations are prohibited
diff --git a/ext/phar/tests/addfuncs.phpt b/ext/phar/tests/addfuncs.phpt
index 9707cb5b1f4..1f892cbcde1 100644
--- a/ext/phar/tests/addfuncs.phpt
+++ b/ext/phar/tests/addfuncs.phpt
@@ -16,27 +16,27 @@
try {
$phar->addFile($pname . '/a');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addFile($pname . '/a', 'a');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addFile(__DIR__ . '/does/not/exist');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addFile($pname . '/a', '.phar/stub.php');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addFromString('.phar/stub.php', 'hi');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -44,8 +44,8 @@
--EXPECTF--
hi
hi
-Entry phar://%saddfuncs.phar.php/a does not exist and cannot be created: phar error: invalid path "phar://%saddfuncs.phar.php/a" contains double slash
-Entry a does not exist and cannot be created: phar error: file "a" in phar "%saddfuncs.phar.php" cannot be opened for writing, readable file pointers are open
-phar error: unable to open file "%s/does/not/exist" to add to phar archive
-Cannot create any files in magic ".phar" directory
-Cannot create any files in magic ".phar" directory
+BadMethodCallException: Entry phar://%saddfuncs.phar.php/a does not exist and cannot be created: phar error: invalid path "phar://%saddfuncs.phar.php/a" contains double slash
+BadMethodCallException: Entry a does not exist and cannot be created: phar error: file "a" in phar "%saddfuncs.phar.php" cannot be opened for writing, readable file pointers are open
+RuntimeException: phar error: unable to open file "%s/does/not/exist" to add to phar archive
+BadMethodCallException: Cannot create any files in magic ".phar" directory
+BadMethodCallException: Cannot create any files in magic ".phar" directory
diff --git a/ext/phar/tests/alias_acrobatics.phpt b/ext/phar/tests/alias_acrobatics.phpt
index b2f80c0abe7..014f2351517 100644
--- a/ext/phar/tests/alias_acrobatics.phpt
+++ b/ext/phar/tests/alias_acrobatics.phpt
@@ -17,19 +17,19 @@
try {
$a = new Phar($fname2, 0, 'foo');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
copy($fname, $fname2);
echo "2\n";
try {
$a = new Phar($fname2);
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b = new Phar($fname, 0, 'another');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -38,7 +38,7 @@
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar');
?>
--EXPECTF--
-alias "foo" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.2.phar"
+UnexpectedValueException: alias "foo" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.2.phar"
2
-Cannot open archive "%salias_acrobatics.2.phar", alias is already in use by existing archive
-alias "another" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.phar"
+UnexpectedValueException: Cannot open archive "%salias_acrobatics.2.phar", alias is already in use by existing archive
+UnexpectedValueException: alias "another" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.phar"
diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt
index efa74678f89..92906283d07 100644
--- a/ext/phar/tests/badparameters.phpt
+++ b/ext/phar/tests/badparameters.phpt
@@ -11,258 +11,258 @@
try {
Phar::mungServer('hi');
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::createDefaultStub(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::loadPhar(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::canCompress('hi');
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = new Phar(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = new Phar(__DIR__ . '/files/frontcontroller10.phar');
} catch (PharException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->convertToExecutable(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->convertToData(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b = new PharData(__DIR__ . '/whatever.tar');
} catch (PharException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c = new PharData(__DIR__ . '/whatever.zip');
} catch (PharException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b->delete(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->delete('oops');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b->delete('oops');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo $a->getPath() . "\n";
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->setAlias('oops');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b->setAlias('oops');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 0);
try {
$a->setAlias(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 1);
try {
$b->stopBuffering();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->setStub('oops');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b->setStub('oops');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 0);
try {
$a->setStub(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 1);
try {
$b->setDefaultStub('oops');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->setDefaultStub(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->setDefaultStub('oops');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->setSignatureAlgorithm(Phar::MD5);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->compress(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->compress(1);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->compressFiles(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->decompressFiles();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->copy(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->copy('a', 'b');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->offsetExists(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->offsetGet(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 0);
try {
$a->offsetSet(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 1);
try {
$b->offsetUnset(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->offsetUnset('a');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->addEmptyDir(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->addFile(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->addFromString(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->setMetadata('a');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 0);
try {
$a->setMetadata(1,2);
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 1);
try {
$a->delMetadata();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Phar::mungServer(): Argument #1 ($variables) must be of type array, string given
-Phar::createDefaultStub(): Argument #1 ($index) must be of type ?string, array given
-Phar::loadPhar(): Argument #1 ($filename) must be of type string, array given
-Phar::canCompress(): Argument #1 ($compression) must be of type int, string given
-Phar::__construct(): Argument #1 ($filename) must be of type string, array given
-Phar::convertToExecutable(): Argument #1 ($format) must be of type ?int, array given
-Phar::convertToData(): Argument #1 ($format) must be of type ?int, array given
-PharData::delete(): Argument #1 ($localName) must be of type string, array given
-Cannot write out phar archive, phar is read-only
-Entry oops does not exist and cannot be deleted
+TypeError: Phar::mungServer(): Argument #1 ($variables) must be of type array, string given
+TypeError: Phar::createDefaultStub(): Argument #1 ($index) must be of type ?string, array given
+TypeError: Phar::loadPhar(): Argument #1 ($filename) must be of type string, array given
+TypeError: Phar::canCompress(): Argument #1 ($compression) must be of type int, string given
+TypeError: Phar::__construct(): Argument #1 ($filename) must be of type string, array given
+TypeError: Phar::convertToExecutable(): Argument #1 ($format) must be of type ?int, array given
+TypeError: Phar::convertToData(): Argument #1 ($format) must be of type ?int, array given
+TypeError: PharData::delete(): Argument #1 ($localName) must be of type string, array given
+UnexpectedValueException: Cannot write out phar archive, phar is read-only
+BadMethodCallException: Entry oops does not exist and cannot be deleted
%sfrontcontroller10.phar
-Cannot write out phar archive, phar is read-only
-A Phar alias cannot be set in a plain tar archive
-Phar::setAlias(): Argument #1 ($alias) must be of type string, array given
-Cannot change stub, phar is read-only
-A Phar stub cannot be set in a plain tar archive
-Phar::setStub(): Argument #1 ($stub) must be of type string, array given
-A Phar stub cannot be set in a plain tar archive
-Phar::setDefaultStub(): Argument #1 ($index) must be of type ?string, array given
-Cannot change stub: phar.readonly=1
-Cannot set signature algorithm, phar is read-only
-Phar::compress(): Argument #1 ($compression) must be of type int, array given
-Cannot compress phar archive, phar is read-only
-Phar::compressFiles(): Argument #1 ($compression) must be of type int, array given
-Phar is readonly, cannot change compression
-Phar::copy() expects exactly 2 arguments, 1 given
-Cannot copy "a" to "b", phar is read-only
-Phar::offsetExists(): Argument #1 ($localName) must be of type string, array given
-Phar::offsetGet(): Argument #1 ($localName) must be of type string, array given
-Phar::offsetSet() expects exactly 2 arguments, 1 given
-PharData::offsetUnset(): Argument #1 ($localName) must be of type string, array given
-Write operations disabled by the php.ini setting phar.readonly
-Phar::addEmptyDir(): Argument #1 ($directory) must be of type string, array given
-Phar::addFile(): Argument #1 ($filename) must be of type string, array given
-Phar::addFromString() expects exactly 2 arguments, 1 given
-Write operations disabled by the php.ini setting phar.readonly
-Phar::setMetadata() expects exactly 1 argument, 2 given
-Write operations disabled by the php.ini setting phar.readonly
+UnexpectedValueException: Cannot write out phar archive, phar is read-only
+UnexpectedValueException: A Phar alias cannot be set in a plain tar archive
+TypeError: Phar::setAlias(): Argument #1 ($alias) must be of type string, array given
+UnexpectedValueException: Cannot change stub, phar is read-only
+UnexpectedValueException: A Phar stub cannot be set in a plain tar archive
+TypeError: Phar::setStub(): Argument #1 ($stub) must be of type string, array given
+UnexpectedValueException: A Phar stub cannot be set in a plain tar archive
+TypeError: Phar::setDefaultStub(): Argument #1 ($index) must be of type ?string, array given
+UnexpectedValueException: Cannot change stub: phar.readonly=1
+UnexpectedValueException: Cannot set signature algorithm, phar is read-only
+TypeError: Phar::compress(): Argument #1 ($compression) must be of type int, array given
+UnexpectedValueException: Cannot compress phar archive, phar is read-only
+TypeError: Phar::compressFiles(): Argument #1 ($compression) must be of type int, array given
+BadMethodCallException: Phar is readonly, cannot change compression
+ArgumentCountError: Phar::copy() expects exactly 2 arguments, 1 given
+UnexpectedValueException: Cannot copy "a" to "b", phar is read-only
+TypeError: Phar::offsetExists(): Argument #1 ($localName) must be of type string, array given
+TypeError: Phar::offsetGet(): Argument #1 ($localName) must be of type string, array given
+ArgumentCountError: Phar::offsetSet() expects exactly 2 arguments, 1 given
+TypeError: PharData::offsetUnset(): Argument #1 ($localName) must be of type string, array given
+BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly
+TypeError: Phar::addEmptyDir(): Argument #1 ($directory) must be of type string, array given
+TypeError: Phar::addFile(): Argument #1 ($filename) must be of type string, array given
+ArgumentCountError: Phar::addFromString() expects exactly 2 arguments, 1 given
+BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly
+ArgumentCountError: Phar::setMetadata() expects exactly 1 argument, 2 given
+BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly
diff --git a/ext/phar/tests/bug13786.phpt b/ext/phar/tests/bug13786.phpt
index d190343b68e..422b1f9b6e5 100644
--- a/ext/phar/tests/bug13786.phpt
+++ b/ext/phar/tests/bug13786.phpt
@@ -21,10 +21,10 @@
echo("\nWritten files: $i\n");
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
string(26) "file 0 in DataArchive.phar"
-unable to seek to start of file "0" while creating new phar "%sDataArchive.phar"
+PharException: unable to seek to start of file "0" while creating new phar "%sDataArchive.phar"
diff --git a/ext/phar/tests/bug45218_SLOWTEST.phpt b/ext/phar/tests/bug45218_SLOWTEST.phpt
index a0ac5922b84..01eacd3899d 100644
--- a/ext/phar/tests/bug45218_SLOWTEST.phpt
+++ b/ext/phar/tests/bug45218_SLOWTEST.phpt
@@ -49,8 +49,7 @@ function rewind() {
}
var_dump($ret);
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/bug48377.2.phpt b/ext/phar/tests/bug48377.2.phpt
index 547e908b11b..a0638b81b3a 100644
--- a/ext/phar/tests/bug48377.2.phpt
+++ b/ext/phar/tests/bug48377.2.phpt
@@ -14,10 +14,10 @@
try {
$phar->convertToData(Phar::ZIP, Phar::NONE, 'phar.zip');
} catch (BadMethodCallException $e) {
- echo $e->getMessage(),"\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.zip');?>
--EXPECTF--
-data phar "%sbug48377.2.phar.zip" has invalid extension phar.zip
+BadMethodCallException: data phar "%sbug48377.2.phar.zip" has invalid extension phar.zip
diff --git a/ext/phar/tests/bug48377.phpt b/ext/phar/tests/bug48377.phpt
index 6b964b97ef9..3fa3b1a3954 100644
--- a/ext/phar/tests/bug48377.phpt
+++ b/ext/phar/tests/bug48377.phpt
@@ -17,11 +17,11 @@
try {
$phar->convertToData(Phar::ZIP, Phar::NONE, 'zip');
} catch (BadMethodCallException $e) {
- echo $e->getMessage(),"\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');?>
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.zip');?>
--EXPECTF--
-phar "%sbug48377.zip" exists and must be unlinked prior to conversion
+BadMethodCallException: phar "%sbug48377.zip" exists and must be unlinked prior to conversion
diff --git a/ext/phar/tests/bug54395.phpt b/ext/phar/tests/bug54395.phpt
index 44c3de0e322..0e4870c8b1a 100644
--- a/ext/phar/tests/bug54395.phpt
+++ b/ext/phar/tests/bug54395.phpt
@@ -8,9 +8,9 @@
try {
phar::mount(1,1);
} catch (Exception $e) {
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-string(25) "Mounting of 1 to 1 failed"
+PharException: Mounting of 1 to 1 failed
diff --git a/ext/phar/tests/bug60261.phpt b/ext/phar/tests/bug60261.phpt
index d56d8c16e9d..6c2a6185a98 100644
--- a/ext/phar/tests/bug60261.phpt
+++ b/ext/phar/tests/bug60261.phpt
@@ -9,9 +9,9 @@
$nx = new Phar();
$nx->getLinkTarget();
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Phar::__construct() expects at least 1 argument, 0 given
+ArgumentCountError: Phar::__construct() expects at least 1 argument, 0 given
diff --git a/ext/phar/tests/bug64931/bug64931.phpt b/ext/phar/tests/bug64931/bug64931.phpt
index 20f708f8294..9475ef38a76 100644
--- a/ext/phar/tests/bug64931/bug64931.phpt
+++ b/ext/phar/tests/bug64931/bug64931.phpt
@@ -15,31 +15,31 @@
try {
$phar->addFile(__DIR__."/src/.pharignore", ".phar/gotcha");
} catch (Exception $e) {
- echo "CAUGHT: ". $e->getMessage() ."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addFromString(".phar", "gotcha");
} catch (Exception $e) {
- echo "CAUGHT: ". $e->getMessage() ."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addFromString(".phar//", "gotcha");
} catch (Exception $e) {
- echo "CAUGHT: ". $e->getMessage() ."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addFromString(".phar\\", "gotcha");
} catch (Exception $e) {
- echo "CAUGHT: ". $e->getMessage() ."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addFromString(".phar\0", "gotcha");
} catch (ValueError $e) {
- echo "CAUGHT: ". $e->getMessage() ."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -49,8 +49,8 @@
?>
--EXPECT--
Test
-CAUGHT: Cannot create any files in magic ".phar" directory
-CAUGHT: Cannot create any files in magic ".phar" directory
-CAUGHT: Cannot create any files in magic ".phar" directory
-CAUGHT: Cannot create any files in magic ".phar" directory
-CAUGHT: Phar::addFromString(): Argument #1 ($localName) must not contain any null bytes
+BadMethodCallException: Cannot create any files in magic ".phar" directory
+BadMethodCallException: Cannot create any files in magic ".phar" directory
+BadMethodCallException: Cannot create any files in magic ".phar" directory
+BadMethodCallException: Cannot create any files in magic ".phar" directory
+ValueError: Phar::addFromString(): Argument #1 ($localName) must not contain any null bytes
diff --git a/ext/phar/tests/bug65028.phpt b/ext/phar/tests/bug65028.phpt
index 4acf364bc4f..436d3e7cb45 100644
--- a/ext/phar/tests/bug65028.phpt
+++ b/ext/phar/tests/bug65028.phpt
@@ -143,7 +143,7 @@
}
catch(UnexpectedValueException $ex)
{
- echo "Exception thrown: " . $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/bug65414.phpt b/ext/phar/tests/bug65414.phpt
index d3ff7794714..4e752b018d0 100644
--- a/ext/phar/tests/bug65414.phpt
+++ b/ext/phar/tests/bug65414.phpt
@@ -19,14 +19,14 @@
$phar->addFromString($bad, 'this content is injected');
echo 'Failed to throw expected exception';
} catch (BadMethodCallException $ex) {
- echo $ex->getMessage() . PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
}
echo 'done' . PHP_EOL;
?>
--EXPECT--
-.phar/injected-1.txt:Cannot create any files in magic ".phar" directory
-/.phar/injected-2.txt:Cannot create any files in magic ".phar" directory
-//.phar/injected-3.txt:Entry //.phar/injected-3.txt does not exist and cannot be created: phar error: invalid path "//.phar/injected-3.txt" contains double slash
-/.phar/:Cannot create any files in magic ".phar" directory
+.phar/injected-1.txt:BadMethodCallException: Cannot create any files in magic ".phar" directory
+/.phar/injected-2.txt:BadMethodCallException: Cannot create any files in magic ".phar" directory
+//.phar/injected-3.txt:BadMethodCallException: Entry //.phar/injected-3.txt does not exist and cannot be created: phar error: invalid path "//.phar/injected-3.txt" contains double slash
+/.phar/:BadMethodCallException: Cannot create any files in magic ".phar" directory
done
diff --git a/ext/phar/tests/bug69324.phpt b/ext/phar/tests/bug69324.phpt
index be7df7ec253..d6ddbea7657 100644
--- a/ext/phar/tests/bug69324.phpt
+++ b/ext/phar/tests/bug69324.phpt
@@ -9,8 +9,8 @@
$meta=$p->getMetadata();
var_dump($meta);
} catch(Exception $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-internal corruption of phar "%s" (truncated manifest entry)
+UnexpectedValueException: internal corruption of phar "%s" (truncated manifest entry)
diff --git a/ext/phar/tests/bug71498.phpt b/ext/phar/tests/bug71498.phpt
index 62b5bbec76b..a426a6597db 100644
--- a/ext/phar/tests/bug71498.phpt
+++ b/ext/phar/tests/bug71498.phpt
@@ -7,11 +7,12 @@
try {
$p = new PharData(__DIR__."/bug71498.zip");
} catch(UnexpectedValueException $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
DONE
--EXPECTF--
-phar error: end of central directory not found in zip-based phar "%s%ebug71498.zip"
+UnexpectedValueException: phar error: end of central directory not found in zip-based phar "%s%ebug71498.zip"
+
DONE
diff --git a/ext/phar/tests/bug72321.phpt b/ext/phar/tests/bug72321.phpt
index 1184be869ac..8c8edb572d4 100644
--- a/ext/phar/tests/bug72321.phpt
+++ b/ext/phar/tests/bug72321.phpt
@@ -12,7 +12,7 @@
try {
$phar->extractTo("test72321");
} catch(PharException $e) {
- print $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
@@ -21,5 +21,5 @@
rmdir(__DIR__."/test72321");
?>
--EXPECTF--
-Extraction from phar "%s72321_2.zip" failed: Cannot extract "AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b/c", could not create directory "test72321/AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b"
+PharException: Extraction from phar "%s72321_2.zip" failed: Cannot extract "AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b/c", could not create directory "test72321/AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b"
DONE
diff --git a/ext/phar/tests/bug72928.phpt b/ext/phar/tests/bug72928.phpt
index 352e1b5c34d..e2a1f99437e 100644
--- a/ext/phar/tests/bug72928.phpt
+++ b/ext/phar/tests/bug72928.phpt
@@ -9,10 +9,10 @@
$phar = new PharData('bug72928.zip');
var_dump($phar);
} catch(UnexpectedValueException $e) {
- print $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
--EXPECTF--
-phar error: signature cannot be read in zip-based phar "%sbug72928.zip"
+UnexpectedValueException: phar error: signature cannot be read in zip-based phar "%sbug72928.zip"
DONE
diff --git a/ext/phar/tests/bug73035.phpt b/ext/phar/tests/bug73035.phpt
index 24965128b72..aba9feb8760 100644
--- a/ext/phar/tests/bug73035.phpt
+++ b/ext/phar/tests/bug73035.phpt
@@ -9,10 +9,10 @@
$phar = new PharData('bug73035.tar');
var_dump($phar);
} catch(UnexpectedValueException $e) {
- print $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
--EXPECTF--
-phar error: tar-based phar "%sbug73035.tar" signature cannot be read
+UnexpectedValueException: phar error: tar-based phar "%sbug73035.tar" signature cannot be read
DONE
diff --git a/ext/phar/tests/bug73764.phpt b/ext/phar/tests/bug73764.phpt
index 7082049b194..4e52efb3ccb 100644
--- a/ext/phar/tests/bug73764.phpt
+++ b/ext/phar/tests/bug73764.phpt
@@ -9,8 +9,8 @@
$p = Phar::LoadPhar('bug73764.phar', 'alias.phar');
echo "OK\n";
} catch(PharException $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-internal corruption of phar "%sbug73764.phar" (truncated manifest entry)
+PharException: internal corruption of phar "%sbug73764.phar" (truncated manifest entry)
diff --git a/ext/phar/tests/bug73768.phpt b/ext/phar/tests/bug73768.phpt
index be73d45cfd5..7de6966130f 100644
--- a/ext/phar/tests/bug73768.phpt
+++ b/ext/phar/tests/bug73768.phpt
@@ -9,8 +9,8 @@
$p = Phar::LoadPhar('bug73768.phar', 'alias.phar');
echo "OK\n";
} catch(PharException $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-internal corruption of phar "%sbug73768.phar" (truncated manifest header)
+PharException: internal corruption of phar "%sbug73768.phar" (truncated manifest header)
diff --git a/ext/phar/tests/bug73809.phpt b/ext/phar/tests/bug73809.phpt
index 375bb7e5e76..c6eaa2dfd94 100644
--- a/ext/phar/tests/bug73809.phpt
+++ b/ext/phar/tests/bug73809.phpt
@@ -16,7 +16,7 @@
try {
$phar = new PharData(__DIR__ . '/73809.zip');
} catch (Exception $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--CLEAN--
@@ -25,4 +25,4 @@
?>
--EXPECTF--
bool(true)
-phar error: signatures larger than 64 KiB are not supported in zip-based phar "%s"
+UnexpectedValueException: phar error: signatures larger than 64 KiB are not supported in zip-based phar "%s"
diff --git a/ext/phar/tests/bug77143.phpt b/ext/phar/tests/bug77143.phpt
index 21b52d6427c..668c90f1321 100644
--- a/ext/phar/tests/bug77143.phpt
+++ b/ext/phar/tests/bug77143.phpt
@@ -11,8 +11,8 @@
var_dump(new Phar('bug77143.phar',0,'project.phar'));
echo "OK\n";
} catch(UnexpectedValueException $e) {
- echo $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-internal corruption of phar "%sbug77143.phar" (truncated manifest header)
+UnexpectedValueException: internal corruption of phar "%sbug77143.phar" (truncated manifest header)
diff --git a/ext/phar/tests/bug77247.phpt b/ext/phar/tests/bug77247.phpt
index acd97a83796..0421f6fa044 100644
--- a/ext/phar/tests/bug77247.phpt
+++ b/ext/phar/tests/bug77247.phpt
@@ -11,4 +11,4 @@
}
?>
--EXPECT--
-OK
\ No newline at end of file
+OK
diff --git a/ext/phar/tests/bug77396.phpt b/ext/phar/tests/bug77396.phpt
index b6c33ab0fcf..fb0eec18d9c 100644
--- a/ext/phar/tests/bug77396.phpt
+++ b/ext/phar/tests/bug77396.phpt
@@ -8,8 +8,8 @@
try {
$phar = new PharData($path);
} catch (UnexpectedValueException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Phar creation or opening failed
+UnexpectedValueException: Phar creation or opening failed
diff --git a/ext/phar/tests/bug79503.phpt b/ext/phar/tests/bug79503.phpt
index 921ad8d18db..3295f95f316 100644
--- a/ext/phar/tests/bug79503.phpt
+++ b/ext/phar/tests/bug79503.phpt
@@ -7,8 +7,8 @@
try {
new Phar(__DIR__ . '/bug79503.phar');
} catch (UnexpectedValueException $ex) {
- echo $ex->getMessage();
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--EXPECTF--
-phar error: tar-based phar "%s%ebug79503.phar" has invalid metadata in magic file ".phar/.metadata.bin"
+UnexpectedValueException: phar error: tar-based phar "%s%ebug79503.phar" has invalid metadata in magic file ".phar/.metadata.bin"
diff --git a/ext/phar/tests/bug81211.phpt b/ext/phar/tests/bug81211.phpt
index fe7b1326aa6..ffeb18af550 100644
--- a/ext/phar/tests/bug81211.phpt
+++ b/ext/phar/tests/bug81211.phpt
@@ -24,12 +24,12 @@
try {
$archive->buildFromDirectory(__DIR__ . '/bug81211/foo');
} catch (UnexpectedValueException $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
try {
$archive->buildFromIterator(new RecursiveDirectoryIterator(__DIR__ . '/bug81211/foo', FilesystemIterator::SKIP_DOTS), __DIR__ . '/bug81211/foo');
} catch (UnexpectedValueException $ex) {
- echo $ex->getMessage(), PHP_EOL;
+ echo $ex::class, ': ', $ex->getMessage(), PHP_EOL;
}
?>
--CLEAN--
@@ -42,5 +42,5 @@
@rmdir(__DIR__ . '/bug81211');
?>
--EXPECTF--
-Iterator RecursiveIteratorIterator returned a path "%s%ebug81211%efoobar%efile" that is not in the base directory "%s%ebug81211%efoo"
-Iterator RecursiveDirectoryIterator returned a path "%s%ebug81211%efoobar%efile" that is not in the base directory "%s%ebug81211%efoo"
+UnexpectedValueException: Iterator RecursiveIteratorIterator returned a path "%s%ebug81211%efoobar%efile" that is not in the base directory "%s%ebug81211%efoo"
+UnexpectedValueException: Iterator RecursiveDirectoryIterator returned a path "%s%ebug81211%efoobar%efile" that is not in the base directory "%s%ebug81211%efoo"
diff --git a/ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt b/ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt
index f43a7a496a7..b6fefa03e02 100644
--- a/ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt
+++ b/ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt
@@ -78,7 +78,7 @@ public function current(): SplFileInfo {
);
$phar->stopBuffering();
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
if ($previous = $e->getPrevious()) {
echo "Previous: ", $previous->getMessage(), "\n";
}
@@ -101,17 +101,17 @@ public function current(): SplFileInfo {
--- Iteration 0 ---
[ Found: %shello.txt ]
[MTime]
-Entry content%chello.txt cannot be created: timestamp is limited to 32-bit
+BadMethodCallException: Entry content%chello.txt cannot be created: timestamp is limited to 32-bit
--- Iteration 1 ---
[ Found: %shello.txt ]
[MTime]
-Entry content%chello.txt cannot be created: getMTime() must return an int
+BadMethodCallException: Entry content%chello.txt cannot be created: getMTime() must return an int
--- Iteration 2 ---
[ Found: %shello.txt ]
[MTime]
-Entry content%chello.txt cannot be created: getMTime() must return an int
+BadMethodCallException: Entry content%chello.txt cannot be created: getMTime() must return an int
Previous: Throwing an exception inside getMTime()
--- Iteration 3 ---
[ Found: %shello.txt ]
[MTime]
-Entry content%chello.txt cannot be created: getMTime() must return an int
+BadMethodCallException: Entry content%chello.txt cannot be created: getMTime() must return an int
diff --git a/ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt b/ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt
index 86b66050a97..d14a63bded4 100644
--- a/ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt
+++ b/ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt
@@ -40,7 +40,7 @@ public function current(): SplFileInfo {
$workdir
);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
if ($previous = $e->getPrevious()) {
echo "Previous: ", $previous->getMessage(), "\n";
}
@@ -59,5 +59,5 @@ public function current(): SplFileInfo {
[ Found: %shello.txt ]
[getPathname]
string(%d) "%shello.txt"
-getPathname() must return a string
+UnexpectedValueException: getPathname() must return a string
Previous: exception in getPathname()
diff --git a/ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt b/ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt
index dfb3fb5f2c5..1c9cd01df2f 100644
--- a/ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt
+++ b/ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt
@@ -40,7 +40,7 @@ public function current(): SplFileInfo {
$workdir
);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$phar->stopBuffering();
@@ -55,4 +55,4 @@ public function current(): SplFileInfo {
--EXPECTF--
[ Found: %scontent%chello.txt ]
[getPathname]
-getPathname() must return a string
+UnexpectedValueException: getPathname() must return a string
diff --git a/ext/phar/tests/create_new_phar_b.phpt b/ext/phar/tests/create_new_phar_b.phpt
index 9d9c8640dd5..d5c54cbbb33 100644
--- a/ext/phar/tests/create_new_phar_b.phpt
+++ b/ext/phar/tests/create_new_phar_b.phpt
@@ -18,4 +18,3 @@
Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d
Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.php/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d
-
diff --git a/ext/phar/tests/create_path_error.phpt b/ext/phar/tests/create_path_error.phpt
index 13a0fea2bb7..5e730248d69 100644
--- a/ext/phar/tests/create_path_error.phpt
+++ b/ext/phar/tests/create_path_error.phpt
@@ -55,7 +55,7 @@ function error_handler($errno, $errmsg)
}
catch (ValueError $e)
{
- echo 'Exception: ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -78,4 +78,4 @@ function error_handler($errno, $errmsg)
11:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character
12:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character
13:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character
-Exception: Phar::offsetSet(): Argument #1 ($localName) must not contain any null bytes
+ValueError: Phar::offsetSet(): Argument #1 ($localName) must not contain any null bytes
diff --git a/ext/phar/tests/delete_in_phar.phpt b/ext/phar/tests/delete_in_phar.phpt
index 78149bf8761..215b2b41df3 100644
--- a/ext/phar/tests/delete_in_phar.phpt
+++ b/ext/phar/tests/delete_in_phar.phpt
@@ -44,4 +44,3 @@
Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.php" in %sdelete_in_phar.php on line %d
Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d
-
diff --git a/ext/phar/tests/delete_in_phar_b.phpt b/ext/phar/tests/delete_in_phar_b.phpt
index 1cc372d53c3..cd73d73ebaf 100644
--- a/ext/phar/tests/delete_in_phar_b.phpt
+++ b/ext/phar/tests/delete_in_phar_b.phpt
@@ -41,4 +41,3 @@
This is a
This is b
This is b/c
-
diff --git a/ext/phar/tests/delete_in_phar_confirm.phpt b/ext/phar/tests/delete_in_phar_confirm.phpt
index 215f20ddf9c..5839382a2b9 100644
--- a/ext/phar/tests/delete_in_phar_confirm.phpt
+++ b/ext/phar/tests/delete_in_phar_confirm.phpt
@@ -48,4 +48,3 @@
Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.php" in %sdelete_in_phar_confirm.php on line %d
Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d
-
diff --git a/ext/phar/tests/fgc_edgecases.phpt b/ext/phar/tests/fgc_edgecases.phpt
index 1daa3a13e59..33c9ca90c39 100644
--- a/ext/phar/tests/fgc_edgecases.phpt
+++ b/ext/phar/tests/fgc_edgecases.phpt
@@ -15,7 +15,7 @@
try {
file_get_contents(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
chdir(__DIR__);
file_put_contents($fname, "blah\n");
@@ -50,7 +50,7 @@
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
<?php unlink(__DIR__ . '/fgc_edgecases.txt'); ?>
--EXPECTF--
-file_get_contents(): Argument #1 ($filename) must be of type string, array given
+TypeError: file_get_contents(): Argument #1 ($filename) must be of type string, array given
blah
<?php
echo file_get_contents("foo/" . basename(__FILE__));
diff --git a/ext/phar/tests/fopen_edgecases.phpt b/ext/phar/tests/fopen_edgecases.phpt
index 5c8e6c87dfb..a60a524bd32 100644
--- a/ext/phar/tests/fopen_edgecases.phpt
+++ b/ext/phar/tests/fopen_edgecases.phpt
@@ -119,4 +119,3 @@
Warning: rename(): phar error: cannot rename "phar://%sfopen_edgecases.phar.php/hi" to "phar://%sfopen_edgecases.phar.php/there": invalid or non-writable url "phar://%sfopen_edgecases.phar.php/hi" in %sfopen_edgecases.php on line %d
Warning: fopen(): Failed to open stream: No such file or directory in phar://%sfopen_edgecases.phar.php/test.php on line %d
-
diff --git a/ext/phar/tests/fopen_edgecases2.phpt b/ext/phar/tests/fopen_edgecases2.phpt
index 697ce81cf33..7a8b386ce4a 100644
--- a/ext/phar/tests/fopen_edgecases2.phpt
+++ b/ext/phar/tests/fopen_edgecases2.phpt
@@ -13,7 +13,7 @@
try {
fopen(array(), 'r');
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
chdir(__DIR__);
file_put_contents($fname, "blah\n");
@@ -37,7 +37,7 @@
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
<?php unlink(__DIR__ . '/fopen_edgecases2.txt'); ?>
--EXPECTF--
-fopen(): Argument #1 ($filename) must be of type string, array given
+TypeError: fopen(): Argument #1 ($filename) must be of type string, array given
blah
test
diff --git a/ext/phar/tests/gh13833.phpt b/ext/phar/tests/gh13833.phpt
index 8430bd5e605..a8aa51f9b57 100644
--- a/ext/phar/tests/gh13833.phpt
+++ b/ext/phar/tests/gh13833.phpt
@@ -30,7 +30,7 @@
try {
new Phar($fname_new);
} catch (UnexpectedValueException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXTENSIONS--
@@ -44,4 +44,4 @@
Yuancheng Jiang <yuancheng@comp.nus.edu.sg>
Felix De Vliegher <felix.devliegher@gmail.com>
--EXPECTF--
-internal corruption of phar "%sgh13833.phar.copy.phar" (trying to read past buffer end)
+UnexpectedValueException: internal corruption of phar "%sgh13833.phar.copy.phar" (trying to read past buffer end)
diff --git a/ext/phar/tests/gh14603.phpt b/ext/phar/tests/gh14603.phpt
index 95b9fa30fd5..409e94bff6d 100644
Binary files a/ext/phar/tests/gh14603.phpt and b/ext/phar/tests/gh14603.phpt differ
diff --git a/ext/phar/tests/gh17518.phpt b/ext/phar/tests/gh17518.phpt
index 6a45e390edd..1761ce4e8c9 100644
--- a/ext/phar/tests/gh17518.phpt
+++ b/ext/phar/tests/gh17518.phpt
@@ -12,7 +12,7 @@
try {
$phar->extractTo(__DIR__ . '/gh17518', '');
} catch (Throwable $e) {
- echo $e::class, ": ", $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/gh19752.phpt b/ext/phar/tests/gh19752.phpt
index 94ee8691305..4c19c7712fb 100644
--- a/ext/phar/tests/gh19752.phpt
+++ b/ext/phar/tests/gh19752.phpt
@@ -8,8 +8,8 @@
try {
$phar->decompress("*");
} catch (BadMethodCallException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-data phar converted from "%sgh19752.1" has invalid extension *
+BadMethodCallException: data phar converted from "%sgh19752.1" has invalid extension *
diff --git a/ext/phar/tests/gh20302.phpt b/ext/phar/tests/gh20302.phpt
index 0cbd253d54f..69277327b44 100644
--- a/ext/phar/tests/gh20302.phpt
+++ b/ext/phar/tests/gh20302.phpt
@@ -23,7 +23,7 @@
try {
new Phar($fname);
} catch (UnexpectedValueException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -33,4 +33,4 @@
@rmdir(__DIR__.'/gh20302');
?>
--EXPECTF--
-Cannot open archive "%sgh20302.phar", alias is already in use by existing archive
+UnexpectedValueException: Cannot open archive "%sgh20302.phar", alias is already in use by existing archive
diff --git a/ext/phar/tests/gh20882.phpt b/ext/phar/tests/gh20882.phpt
index 8928178a22a..3e437fdfe02 100644
--- a/ext/phar/tests/gh20882.phpt
+++ b/ext/phar/tests/gh20882.phpt
@@ -15,8 +15,8 @@
null
);
} catch (BadMethodCallException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Iterator RecursiveIteratorIterator returns an SplFileInfo object, so base directory must be specified
+BadMethodCallException: Iterator RecursiveIteratorIterator returns an SplFileInfo object, so base directory must be specified
diff --git a/ext/phar/tests/gh21798-offsetget-temp-entry.phpt b/ext/phar/tests/gh21798-offsetget-temp-entry.phpt
index b5b11ad4363..e4b16cfb114 100644
--- a/ext/phar/tests/gh21798-offsetget-temp-entry.phpt
+++ b/ext/phar/tests/gh21798-offsetget-temp-entry.phpt
@@ -16,24 +16,24 @@
try {
$phar->offsetGet('.phar/stub.php');
} catch (BadMethodCallException $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->offsetGet('.phar/alias.txt');
} catch (BadMethodCallException $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->offsetGet('.phar/internal');
} catch (BadMethodCallException $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "no crash\n";
?>
--CLEAN--
<?php @unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
--EXPECT--
-Entry .phar/stub.php does not exist
-Entry .phar/alias.txt does not exist
-Entry .phar/internal does not exist
+BadMethodCallException: Entry .phar/stub.php does not exist
+BadMethodCallException: Entry .phar/alias.txt does not exist
+BadMethodCallException: Entry .phar/internal does not exist
no crash
diff --git a/ext/phar/tests/invalid_alias.phpt b/ext/phar/tests/invalid_alias.phpt
index 231dd9fdb31..1f85b5cfdcb 100644
--- a/ext/phar/tests/invalid_alias.phpt
+++ b/ext/phar/tests/invalid_alias.phpt
@@ -12,28 +12,28 @@
try {
$p->setAlias('hi/');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p->setAlias('hi\\l');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p->setAlias('hil;');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p->setAlias(':hil');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Invalid alias "hi/" specified for phar "%sinvalid_alias.phar"
-Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar"
-Invalid alias "hil;" specified for phar "%sinvalid_alias.phar"
-Invalid alias ":hil" specified for phar "%sinvalid_alias.phar"
+UnexpectedValueException: Invalid alias "hi/" specified for phar "%sinvalid_alias.phar"
+UnexpectedValueException: Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar"
+UnexpectedValueException: Invalid alias "hil;" specified for phar "%sinvalid_alias.phar"
+UnexpectedValueException: Invalid alias ":hil" specified for phar "%sinvalid_alias.phar"
diff --git a/ext/phar/tests/invalid_setstubalias.phpt b/ext/phar/tests/invalid_setstubalias.phpt
index bcbcb266692..642cdf8b367 100644
--- a/ext/phar/tests/invalid_setstubalias.phpt
+++ b/ext/phar/tests/invalid_setstubalias.phpt
@@ -13,28 +13,28 @@
try {
$p['.phar/stub.php'] = 'hi';
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p['.phar/alias.txt'] = 'hi';
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$p = new Phar($fname2);
try {
$p['.phar/stub.php'] = 'hi';
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p['.phar/alias.txt'] = 'hi';
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.tar", use setStub
-Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.tar", use setAlias
-Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.zip", use setStub
-Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.zip", use setAlias
+BadMethodCallException: Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.tar", use setStub
+BadMethodCallException: Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.tar", use setAlias
+BadMethodCallException: Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.zip", use setStub
+BadMethodCallException: Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.zip", use setAlias
diff --git a/ext/phar/tests/invalid_string_phar_mungserver.phpt b/ext/phar/tests/invalid_string_phar_mungserver.phpt
index 8128987dacb..86116c90974 100644
--- a/ext/phar/tests/invalid_string_phar_mungserver.phpt
+++ b/ext/phar/tests/invalid_string_phar_mungserver.phpt
@@ -9,9 +9,9 @@
try {
Phar::mungServer([&$str]);
} catch (PharException $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Invalid value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME
+PharException: Invalid value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME
diff --git a/ext/phar/tests/mkdir.phpt b/ext/phar/tests/mkdir.phpt
index 9955574caac..86835b866b7 100644
--- a/ext/phar/tests/mkdir.phpt
+++ b/ext/phar/tests/mkdir.phpt
@@ -22,12 +22,12 @@
try {
$a->addEmptyDir('.phar');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->addEmptyDir('/.phar');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
$a->addEmptyDir('/.pharx');
var_dump(is_dir($pname . '/.pharx'));
@@ -49,6 +49,6 @@
Warning: rmdir(): phar error: cannot remove directory "" in phar "foo.phar", directory does not exist in %smkdir.php on line %d
Warning: rmdir(): phar error: cannot remove directory "a" in phar "%smkdir.phar.php", phar error: path "a" exists and is not a directory in %smkdir.php on line %d
-Cannot create a directory in magic ".phar" directory
-Cannot create a directory in magic ".phar" directory
+BadMethodCallException: Cannot create a directory in magic ".phar" directory
+BadMethodCallException: Cannot create a directory in magic ".phar" directory
bool(true)
diff --git a/ext/phar/tests/mounteddir.phpt b/ext/phar/tests/mounteddir.phpt
index e9f9bbec468..923e3efebb9 100644
--- a/ext/phar/tests/mounteddir.phpt
+++ b/ext/phar/tests/mounteddir.phpt
@@ -62,22 +62,22 @@
try {
Phar::mount($pname . '/testit', 'another\\..\\mistake');
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::mount($pname . '/notfound', __DIR__ . '/this/does/not/exist');
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::mount($pname . '/testit', __DIR__);
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::mount($pname . '/testit/extfile.php', __DIR__);
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -109,7 +109,7 @@
phar://%stempmanifest1.phar.php/testit%cdirectory
phar://%stempmanifest1.phar.php/testit%cextfile.php
phar://%stempmanifest1.phar.php/testit%cextfile2.php
-Mounting of /testit to another\..\mistake within phar %stempmanifest1.phar.php failed
-Mounting of /notfound to %stests/this/does/not/exist within phar %stempmanifest1.phar.php failed
-Mounting of /testit to %stests within phar %stests/tempmanifest1.phar.php failed
-Mounting of /testit/extfile.php to %stests within phar %stests/tempmanifest1.phar.php failed
+PharException: Mounting of /testit to another\..\mistake within phar %stempmanifest1.phar.php failed
+PharException: Mounting of /notfound to %stests/this/does/not/exist within phar %stempmanifest1.phar.php failed
+PharException: Mounting of /testit to %stests within phar %stests/tempmanifest1.phar.php failed
+PharException: Mounting of /testit/extfile.php to %stests within phar %stests/tempmanifest1.phar.php failed
diff --git a/ext/phar/tests/open_for_write_newfile_b.phpt b/ext/phar/tests/open_for_write_newfile_b.phpt
index 76248ceeb6f..844eb939f94 100644
--- a/ext/phar/tests/open_for_write_newfile_b.phpt
+++ b/ext/phar/tests/open_for_write_newfile_b.phpt
@@ -32,4 +32,3 @@
Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d
Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d
-
diff --git a/ext/phar/tests/open_for_write_newfile_c.phpt b/ext/phar/tests/open_for_write_newfile_c.phpt
index 9a940823dd3..a118bf29a6c 100644
--- a/ext/phar/tests/open_for_write_newfile_c.phpt
+++ b/ext/phar/tests/open_for_write_newfile_c.phpt
@@ -32,4 +32,3 @@
Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d
Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d
-
diff --git a/ext/phar/tests/opendir_edgecases.phpt b/ext/phar/tests/opendir_edgecases.phpt
index 4d35f0655c9..b316537868d 100644
--- a/ext/phar/tests/opendir_edgecases.phpt
+++ b/ext/phar/tests/opendir_edgecases.phpt
@@ -15,7 +15,7 @@
try {
opendir(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
mkdir(__DIR__ . '/opendir_edgecases');
@@ -55,7 +55,7 @@
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
<?php rmdir(__DIR__ . '/opendir_edgecases');
--EXPECTF--
-opendir(): Argument #1 ($directory) must be of type string, array given
+TypeError: opendir(): Argument #1 ($directory) must be of type string, array given
.
..
foo
diff --git a/ext/phar/tests/phar_buildfromdirectory1.phpt b/ext/phar/tests/phar_buildfromdirectory1.phpt
index 9ab1fb92151..3a49195285d 100644
--- a/ext/phar/tests/phar_buildfromdirectory1.phpt
+++ b/ext/phar/tests/phar_buildfromdirectory1.phpt
@@ -12,10 +12,8 @@
ini_set('phar.readonly', 1);
$phar->buildFromDirectory(1);
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-%s(24) "UnexpectedValueException"
-Cannot write to archive - write operations restricted by INI setting
+UnexpectedValueException: Cannot write to archive - write operations restricted by INI setting
diff --git a/ext/phar/tests/phar_buildfromdirectory2.phpt b/ext/phar/tests/phar_buildfromdirectory2.phpt
index b5f14671dbf..a13d99ebdfe 100644
--- a/ext/phar/tests/phar_buildfromdirectory2.phpt
+++ b/ext/phar/tests/phar_buildfromdirectory2.phpt
@@ -15,10 +15,8 @@
$phar = new Phar(__DIR__ . '/buildfromdirectory2.phar');
$phar->buildFromDirectory(1);
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-%s(24) "UnexpectedValueException"
-RecursiveDirectoryIterator::__construct(): Failed to open directory: No such file or directory
+UnexpectedValueException: RecursiveDirectoryIterator::__construct(): Failed to open directory: No such file or directory
diff --git a/ext/phar/tests/phar_buildfromdirectory4.phpt b/ext/phar/tests/phar_buildfromdirectory4.phpt
index 79bb51caa00..d7c077e9c28 100644
--- a/ext/phar/tests/phar_buildfromdirectory4.phpt
+++ b/ext/phar/tests/phar_buildfromdirectory4.phpt
@@ -20,8 +20,7 @@
asort($a);
var_dump($a);
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(file_exists(__DIR__ . '/buildfromdirectory4.phar'));
diff --git a/ext/phar/tests/phar_buildfromdirectory5.phpt b/ext/phar/tests/phar_buildfromdirectory5.phpt
index 2d468fe3535..e4a5b524531 100644
--- a/ext/phar/tests/phar_buildfromdirectory5.phpt
+++ b/ext/phar/tests/phar_buildfromdirectory5.phpt
@@ -19,8 +19,7 @@
asort($a);
var_dump($a);
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(file_exists(__DIR__ . '/buildfromdirectory5.phar'));
diff --git a/ext/phar/tests/phar_buildfromdirectory6.phpt b/ext/phar/tests/phar_buildfromdirectory6.phpt
index a652a89921d..c5dd0a58fe2 100644
--- a/ext/phar/tests/phar_buildfromdirectory6.phpt
+++ b/ext/phar/tests/phar_buildfromdirectory6.phpt
@@ -17,8 +17,7 @@
$phar = new Phar(__DIR__ . '/buildfromdirectory6.phar');
var_dump($phar->buildFromDirectory(__DIR__ . '/testdir6', '/\.php$/'));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(file_exists(__DIR__ . '/buildfromdirectory6.phar'));
diff --git a/ext/phar/tests/phar_buildfromiterator1.phpt b/ext/phar/tests/phar_buildfromiterator1.phpt
index 23daf212054..812191fea91 100644
--- a/ext/phar/tests/phar_buildfromiterator1.phpt
+++ b/ext/phar/tests/phar_buildfromiterator1.phpt
@@ -13,10 +13,8 @@
$phar->buildFromIterator(new ArrayIterator([]));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-%s(24) "UnexpectedValueException"
-Cannot write out phar archive, phar is read-only
+UnexpectedValueException: Cannot write out phar archive, phar is read-only
diff --git a/ext/phar/tests/phar_buildfromiterator10.phpt b/ext/phar/tests/phar_buildfromiterator10.phpt
index 495f177fabb..b4bf1049040 100644
--- a/ext/phar/tests/phar_buildfromiterator10.phpt
+++ b/ext/phar/tests/phar_buildfromiterator10.phpt
@@ -18,8 +18,7 @@
asort($a);
var_dump($a);
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/phar_buildfromiterator4.phpt b/ext/phar/tests/phar_buildfromiterator4.phpt
index e7bccc27c95..30c73cd670c 100644
--- a/ext/phar/tests/phar_buildfromiterator4.phpt
+++ b/ext/phar/tests/phar_buildfromiterator4.phpt
@@ -47,8 +47,7 @@ function rewind(): void {
'.phar/oops' => basename(__FILE__, 'php') . 'phpt',
))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/phar_buildfromiterator5.phpt b/ext/phar/tests/phar_buildfromiterator5.phpt
index 2ddf1c282ec..f1545789763 100644
--- a/ext/phar/tests/phar_buildfromiterator5.phpt
+++ b/ext/phar/tests/phar_buildfromiterator5.phpt
@@ -40,13 +40,11 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator5.phar');
var_dump($phar->buildFromIterator(new myIterator(array('a' => new stdClass))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
rewind
valid
current
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)
+UnexpectedValueException: Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)
diff --git a/ext/phar/tests/phar_buildfromiterator6.phpt b/ext/phar/tests/phar_buildfromiterator6.phpt
index 4e4f09f74aa..2ff938c8c68 100644
--- a/ext/phar/tests/phar_buildfromiterator6.phpt
+++ b/ext/phar/tests/phar_buildfromiterator6.phpt
@@ -40,8 +40,7 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator6.phar');
var_dump($phar->buildFromIterator(new myIterator(array(basename(__FILE__, 'php') . 'phpt'))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -49,5 +48,4 @@ function rewind(): void {
valid
current
key
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned an invalid key (must return a string)
+UnexpectedValueException: Iterator myIterator returned an invalid key (must return a string)
diff --git a/ext/phar/tests/phar_buildfromiterator7.phpt b/ext/phar/tests/phar_buildfromiterator7.phpt
index 646bcdac2a5..662cbdfe09a 100644
--- a/ext/phar/tests/phar_buildfromiterator7.phpt
+++ b/ext/phar/tests/phar_buildfromiterator7.phpt
@@ -40,8 +40,7 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator7.phar');
var_dump($phar->buildFromIterator(new myIterator(array('a' => basename(__FILE__, 'php') . '/oopsie/there.phpt'))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -49,5 +48,4 @@ function rewind(): void {
valid
current
key
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
+UnexpectedValueException: Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
diff --git a/ext/phar/tests/phar_buildfromiterator8.phpt b/ext/phar/tests/phar_buildfromiterator8.phpt
index 6dbe9dcd3f9..9a4c069a4ce 100644
--- a/ext/phar/tests/phar_buildfromiterator8.phpt
+++ b/ext/phar/tests/phar_buildfromiterator8.phpt
@@ -13,8 +13,7 @@
asort($a);
var_dump($a);
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/phar_buildfromiterator9.phpt b/ext/phar/tests/phar_buildfromiterator9.phpt
index a2cb24d8cc7..45a217a92ba 100644
--- a/ext/phar/tests/phar_buildfromiterator9.phpt
+++ b/ext/phar/tests/phar_buildfromiterator9.phpt
@@ -41,8 +41,7 @@ function rewind(): void {
var_dump($phar->buildFromIterator(new myIterator(array('a' => $a = fopen(basename(__FILE__, 'php') . 'phpt', 'r')))));
fclose($a);
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/phar_bz2.phpt b/ext/phar/tests/phar_bz2.phpt
index bb0a98101fa..4c52231b7a8 100644
--- a/ext/phar/tests/phar_bz2.phpt
+++ b/ext/phar/tests/phar_bz2.phpt
@@ -41,7 +41,7 @@
try {
$b->isFileFormat(25);
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -54,4 +54,4 @@
string(%d) "phar://%sphar_bz2.phar/tar_004.php"
bool(true)
bool(true)
-Unknown file format specified
+PharException: Unknown file format specified
diff --git a/ext/phar/tests/phar_construct_invalidurl.phpt b/ext/phar/tests/phar_construct_invalidurl.phpt
index af281a56fe8..f47156c6332 100644
--- a/ext/phar/tests/phar_construct_invalidurl.phpt
+++ b/ext/phar/tests/phar_construct_invalidurl.phpt
@@ -9,20 +9,20 @@
try {
$a = new Phar('http://should.fail.com');
} catch (UnexpectedValueException $e) {
- echo $e->getMessage(),"\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = new Phar('http://');
} catch (UnexpectedValueException $e) {
- echo $e->getMessage(),"\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = new Phar('http:/');
} catch (UnexpectedValueException $e) {
- echo $e->getMessage(),"\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot create a phar archive from a URL like "http://should.fail.com". Phar objects can only be created from local files
-Cannot create a phar archive from a URL like "http://". Phar objects can only be created from local files
-Cannot create phar 'http:/', file extension (or combination) not recognised or the directory does not exist
+UnexpectedValueException: Cannot create a phar archive from a URL like "http://should.fail.com". Phar objects can only be created from local files
+UnexpectedValueException: Cannot create a phar archive from a URL like "http://". Phar objects can only be created from local files
+UnexpectedValueException: Cannot create phar 'http:/', file extension (or combination) not recognised or the directory does not exist
diff --git a/ext/phar/tests/phar_convert_again.phpt b/ext/phar/tests/phar_convert_again.phpt
index 008d28ad80f..831e1075d22 100644
--- a/ext/phar/tests/phar_convert_again.phpt
+++ b/ext/phar/tests/phar_convert_again.phpt
@@ -33,7 +33,7 @@
try {
$phar = $tbz->convertToExecutable(Phar::PHAR, Phar::NONE);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
copy($tbz->getPath(), $fname2);
$tbz = new PharData($fname2);
@@ -50,17 +50,17 @@
try {
$data->setStub('hi');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$data->setDefaultStub();
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$data->setAlias('hi');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
$tar = $phar->convertToExecutable(Phar::TAR);
echo $tar->getPath() . "\n";
@@ -71,85 +71,85 @@
try {
$tgz->convertToExecutable(25);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToExecutable(Phar::ZIP, Phar::GZ);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToExecutable(Phar::ZIP, Phar::BZ2);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->convertToData();
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToData(Phar::PHAR);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToData(25);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToData(Phar::ZIP, Phar::GZ);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToData(Phar::ZIP, Phar::BZ2);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToExecutable(Phar::TAR, 25);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToData(Phar::TAR, 25);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
// extra code coverage
try {
$data->setStub('hi');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$data->setAlias('hi');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$data->setDefaultStub();
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToData(Phar::TAR, Phar::GZ, '.phar.tgz.oops');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->convertToExecutable(Phar::TAR, Phar::GZ, '.tgz.oops');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$tgz->convertToData(Phar::TAR, Phar::GZ, '.phar/.tgz.oops');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -171,30 +171,30 @@
%sphar_convert_again.zip
%sphar_convert_again.tar.gz
%sphar_convert_again.tar.bz2
-Unable to add newly converted phar "%sphar_convert_again.phar" to the list of phars, a phar with that name already exists
+BadMethodCallException: Unable to add newly converted phar "%sphar_convert_again.phar" to the list of phars, a phar with that name already exists
%sphar_convert_again2.phar
%sphar_convert_again2.phar.zip
hi
%sphar_convert_again2.zip
-A Phar stub cannot be set in a plain zip archive
-A Phar stub cannot be set in a plain zip archive
-A Phar alias cannot be set in a plain zip archive
+UnexpectedValueException: A Phar stub cannot be set in a plain zip archive
+UnexpectedValueException: A Phar stub cannot be set in a plain zip archive
+UnexpectedValueException: A Phar alias cannot be set in a plain zip archive
%sphar_convert_again2.phar.tar
%sphar_convert_again2.tar
%sphar_convert_again2.phar.tar.gz
-Unknown file format specified, please pass one of Phar::PHAR, Phar::TAR or Phar::ZIP
-Cannot compress entire archive with gzip, zip archives do not support whole-archive compression
-Cannot compress entire archive with bz2, zip archives do not support whole-archive compression
-Cannot write out data phar archive, use Phar::TAR or Phar::ZIP
-Cannot write out data phar archive, use Phar::TAR or Phar::ZIP
-Unknown file format specified, please pass one of Phar::TAR or Phar::ZIP
-Cannot compress entire archive with gzip, zip archives do not support whole-archive compression
-Cannot compress entire archive with bz2, zip archives do not support whole-archive compression
-Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2
-Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2
-A Phar stub cannot be set in a plain tar archive
-A Phar alias cannot be set in a plain tar archive
-A Phar stub cannot be set in a plain tar archive
-data phar "%sphar_convert_again2.phar.tgz.oops" has invalid extension phar.tgz.oops
-phar "%sphar_convert_again2.tgz.oops" has invalid extension tgz.oops
-data phar "%sphar_convert_again2.phar/.tgz.oops" has invalid extension phar/.tgz.oops
+BadMethodCallException: Unknown file format specified, please pass one of Phar::PHAR, Phar::TAR or Phar::ZIP
+BadMethodCallException: Cannot compress entire archive with gzip, zip archives do not support whole-archive compression
+BadMethodCallException: Cannot compress entire archive with bz2, zip archives do not support whole-archive compression
+UnexpectedValueException: Cannot write out data phar archive, use Phar::TAR or Phar::ZIP
+UnexpectedValueException: Cannot write out data phar archive, use Phar::TAR or Phar::ZIP
+BadMethodCallException: Unknown file format specified, please pass one of Phar::TAR or Phar::ZIP
+BadMethodCallException: Cannot compress entire archive with gzip, zip archives do not support whole-archive compression
+BadMethodCallException: Cannot compress entire archive with bz2, zip archives do not support whole-archive compression
+BadMethodCallException: Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2
+BadMethodCallException: Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2
+UnexpectedValueException: A Phar stub cannot be set in a plain tar archive
+UnexpectedValueException: A Phar alias cannot be set in a plain tar archive
+UnexpectedValueException: A Phar stub cannot be set in a plain tar archive
+BadMethodCallException: data phar "%sphar_convert_again2.phar.tgz.oops" has invalid extension phar.tgz.oops
+BadMethodCallException: phar "%sphar_convert_again2.tgz.oops" has invalid extension tgz.oops
+BadMethodCallException: data phar "%sphar_convert_again2.phar/.tgz.oops" has invalid extension phar/.tgz.oops
diff --git a/ext/phar/tests/phar_convert_metadata_leak.phpt b/ext/phar/tests/phar_convert_metadata_leak.phpt
index 61a240c8888..1b2a64c13e0 100644
--- a/ext/phar/tests/phar_convert_metadata_leak.phpt
+++ b/ext/phar/tests/phar_convert_metadata_leak.phpt
@@ -15,10 +15,10 @@
try {
$phar->convertToData(Phar::ZIP, Phar::NONE, 'phar.zip');
} catch (BadMethodCallException $e) {
- echo $e->getMessage(),"\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.zip');?>
--EXPECTF--
-data phar "%s" has invalid extension phar.zip
+BadMethodCallException: data phar "%s" has invalid extension phar.zip
diff --git a/ext/phar/tests/phar_convert_repeated_b.phpt b/ext/phar/tests/phar_convert_repeated_b.phpt
index 8adb581276f..ae2d52c5fd2 100644
--- a/ext/phar/tests/phar_convert_repeated_b.phpt
+++ b/ext/phar/tests/phar_convert_repeated_b.phpt
@@ -50,7 +50,7 @@
var_dump(strlen($phar->getStub()));
var_dump($phar->getAlias());
} catch(Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "================ convertToTar(GZ) ====================\n";
@@ -72,7 +72,7 @@
var_dump(strlen($phar->getStub()));
var_dump($phar->getAlias());
} catch(Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -102,7 +102,7 @@
string(0) ""
NULL
================= convertToPhar() ====================
-Cannot write out executable phar archive, phar is read-only
+UnexpectedValueException: Cannot write out executable phar archive, phar is read-only
================ convertToTar(GZ) ====================
bool(false)
bool(true)
@@ -110,4 +110,4 @@
string(0) ""
NULL
================= convertToPhar() ====================
-Cannot write out executable phar archive, phar is read-only
+UnexpectedValueException: Cannot write out executable phar archive, phar is read-only
diff --git a/ext/phar/tests/phar_create_in_cwd.phpt b/ext/phar/tests/phar_create_in_cwd.phpt
index 7aed3a5d590..f13418b325a 100644
--- a/ext/phar/tests/phar_create_in_cwd.phpt
+++ b/ext/phar/tests/phar_create_in_cwd.phpt
@@ -22,7 +22,7 @@
?>");
var_dump($p->getStub());
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/phar_createdefaultstub.phpt b/ext/phar/tests/phar_createdefaultstub.phpt
index 8c2878b71e0..fc17ef72c68 100644
--- a/ext/phar/tests/phar_createdefaultstub.phpt
+++ b/ext/phar/tests/phar_createdefaultstub.phpt
@@ -16,7 +16,7 @@
echo "============================================================================\n";
var_dump(Phar::createDefaultStub(str_repeat('a', 401)));
} catch(Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "============================================================================\n";
echo "============================================================================\n";
@@ -29,7 +29,7 @@
var_dump(strlen(Phar::createDefaultStub('index.php', str_repeat('a', 400))));
var_dump(Phar::createDefaultStub('hio', str_repeat('a', 401)));
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -636,7 +636,7 @@ static function _removeTmpFiles($temp, $origdir)
int(7050)
============================================================================
============================================================================
-Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
+PharException: Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
============================================================================
============================================================================
============================================================================
@@ -942,4 +942,4 @@ static function _removeTmpFiles($temp, $origdir)
============================================================================
============================================================================
int(7050)
-Illegal web filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
+PharException: Illegal web filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
diff --git a/ext/phar/tests/phar_decompress.phpt b/ext/phar/tests/phar_decompress.phpt
index 0983b77fcb5..a8a558c624e 100644
--- a/ext/phar/tests/phar_decompress.phpt
+++ b/ext/phar/tests/phar_decompress.phpt
@@ -37,12 +37,12 @@
try {
$gz->decompress();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$zip->decompress();
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -60,5 +60,5 @@
%sphar_decompress2.phar
%sphar_decompress.phar
%sphar_decompress.hooba.phar
-Cannot decompress phar archive, phar is read-only
-Cannot decompress zip-based archives with whole-archive compression
+UnexpectedValueException: Cannot decompress phar archive, phar is read-only
+UnexpectedValueException: Cannot decompress zip-based archives with whole-archive compression
diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt
index 7d50a3bed74..691aa831ab8 100644
--- a/ext/phar/tests/phar_extract.phpt
+++ b/ext/phar/tests/phar_extract.phpt
@@ -47,19 +47,19 @@
try {
$a->extractTo(__DIR__ . '/whatever', new stdClass());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->extractTo(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->extractTo('');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
file_put_contents(__DIR__ . '/oops', 'I is file');
@@ -67,19 +67,19 @@
try {
$a->extractTo(__DIR__ . '/oops', 'file1.txt');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->extractTo(__DIR__ . '/oops1', array(array(), 'file1.txt'));
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->extractTo(__DIR__ . '/extract', 'file1.txt');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
file_put_contents(__DIR__ . '/extract/file1.txt', 'first');
@@ -91,7 +91,7 @@
try {
$a->extractTo(str_repeat('a', 20000), 'file1.txt');
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$a[str_repeat('a', 20000)] = 'long';
@@ -99,7 +99,7 @@
try {
$a->extractTo(__DIR__ . '/extract', str_repeat('a', 20000));
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -138,13 +138,13 @@
string(3) "hi3"
string(3) "hi2"
bool(false)
-Phar::extractTo(): Argument #2 ($files) must be of type array|string|null, stdClass given
-Phar::extractTo(): Argument #1 ($directory) must be of type string, array given
-Invalid argument, extraction path must be non-zero length
-Unable to use path "%soops" for extraction, it is a file, must be a directory
-Invalid argument, array of filenames to extract contains non-string value
-Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "file1.txt" to "%sextract/file1.txt", path already exists
+TypeError: Phar::extractTo(): Argument #2 ($files) must be of type array|string|null, stdClass given
+TypeError: Phar::extractTo(): Argument #1 ($directory) must be of type string, array given
+InvalidArgumentException: Invalid argument, extraction path must be non-zero length
+RuntimeException: Unable to use path "%soops" for extraction, it is a file, must be a directory
+InvalidArgumentException: Invalid argument, array of filenames to extract contains non-string value
+PharException: Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "file1.txt" to "%sextract/file1.txt", path already exists
string(5) "first"
string(2) "hi"
-Cannot extract to "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...", destination directory is too long for filesystem
-Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." to "%s...", extracted filename is too long for filesystem
+InvalidArgumentException: Cannot extract to "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...", destination directory is too long for filesystem
+PharException: Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." to "%s...", extracted filename is too long for filesystem
diff --git a/ext/phar/tests/phar_extract3.phpt b/ext/phar/tests/phar_extract3.phpt
index 1bd46781b2a..381070b2c8b 100644
--- a/ext/phar/tests/phar_extract3.phpt
+++ b/ext/phar/tests/phar_extract3.phpt
@@ -16,7 +16,7 @@
try {
$phar->extractTo($extract);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$phar = new PharData($fname2);
@@ -27,7 +27,7 @@
try {
$phar->extractTo($extract);
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -39,6 +39,6 @@
@rmdir($dir);
?>
--EXPECTF--
-Invalid argument, %sfiles/bogus.zip cannot be found
+InvalidArgumentException: Invalid argument, %sfiles/bogus.zip cannot be found
phar://%sfiles/notbogus.zip%cnonsense.txt
phar://%sfiles/notbogus.zip%cstuff.txt
diff --git a/ext/phar/tests/phar_magic_dir_prefix.phpt b/ext/phar/tests/phar_magic_dir_prefix.phpt
index e1f1c517632..33783a8c6c6 100644
--- a/ext/phar/tests/phar_magic_dir_prefix.phpt
+++ b/ext/phar/tests/phar_magic_dir_prefix.phpt
@@ -43,13 +43,13 @@
try {
$phar->addFromString('.phar/still-magic.txt', 'no');
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->addEmptyDir('/.phar');
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -76,5 +76,5 @@
[2]=>
string(15) "from-string.txt"
}
-Cannot create any files in magic ".phar" directory
-Cannot create a directory in magic ".phar" directory
+BadMethodCallException: Cannot create any files in magic ".phar" directory
+BadMethodCallException: Cannot create a directory in magic ".phar" directory
diff --git a/ext/phar/tests/phar_metadata_write4.phpt b/ext/phar/tests/phar_metadata_write4.phpt
index ad9f4d47d91..31bed1699f9 100644
--- a/ext/phar/tests/phar_metadata_write4.phpt
+++ b/ext/phar/tests/phar_metadata_write4.phpt
@@ -55,7 +55,7 @@ public function __sleep() {
try {
var_dump($phar['a']->setMetadata(new ThrowsOnSerialize()));
} catch (RuntimeException $e) {
- echo "Caught {$e->getMessage()} at {$e->getFile()}:{$e->getLine()}\n";
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
unset($e);
}
var_dump($phar['a']->getMetadata([]));
@@ -90,7 +90,7 @@ public function __sleep() {
object(EchoesOnWakeup)#2 (0) {
}
In __destruct 2
-Caught In sleep at %sphar_metadata_write4.php:12
+RuntimeException: In sleep in %sphar_metadata_write4.php on line 12
In __wakeup 3
object(EchoesOnWakeup)#3 (0) {
}
@@ -98,4 +98,4 @@ public function __sleep() {
object(__PHP_Incomplete_Class)#4 (1) {
["__PHP_Incomplete_Class_Name"]=>
string(14) "EchoesOnWakeup"
-}
\ No newline at end of file
+}
diff --git a/ext/phar/tests/phar_mount.phpt b/ext/phar/tests/phar_mount.phpt
index ca383839848..4dfcb7f139f 100644
--- a/ext/phar/tests/phar_mount.phpt
+++ b/ext/phar/tests/phar_mount.phpt
@@ -39,12 +39,12 @@
try {
include $fname2;
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::mount($pname . '/oops', '/home/oops/../../etc/passwd:');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
Phar::mount($pname . '/testit2', $pname . '/testit1');
echo substr($a['testit2']->getContent(),0, 50),"\n";
@@ -55,7 +55,7 @@
--EXPECTF--
Mounting of testit to %sphar_mount.php within phar %sphar_mount.phar.php failed
Can only mount internal paths within a phar archive, use a relative path instead of "phar://%sphar_mount.phar.php/testit1"
-Mounting of testit to %sphar_mount.php within phar %sphar_mount.phar.tar failed
-Mounting of /oops to /home/oops/../../etc/passwd: within phar %sphar_mount.phar.php failed
+PharException: Mounting of testit to %sphar_mount.php within phar %sphar_mount.phar.tar failed
+PharException: Mounting of /oops to /home/oops/../../etc/passwd: within phar %sphar_mount.phar.php failed
<?php
$fname = dirname(__FILE__) . '/' . basename(
diff --git a/ext/phar/tests/phar_offset_check.phpt b/ext/phar/tests/phar_offset_check.phpt
index 5a039d2d893..b4adbc57291 100644
--- a/ext/phar/tests/phar_offset_check.phpt
+++ b/ext/phar/tests/phar_offset_check.phpt
@@ -20,19 +20,19 @@
try {
$phar->offsetGet('.phar/stub.php');
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->offsetGet('.phar/alias.txt');
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->offsetSet('.phar/stub.php', '<?php __HALT_COMPILER(); ?>');
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(strlen($phar->getStub()));
@@ -40,7 +40,7 @@
try {
$phar->offsetUnset('.phar/stub.php');
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(strlen($phar->getStub()));
@@ -48,7 +48,7 @@
try {
$phar->offsetSet('.phar/alias.txt', 'dolly');
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getAlias());
@@ -56,7 +56,7 @@
try {
$phar->offsetUnset('.phar/alias.txt');
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getAlias());
@@ -65,11 +65,11 @@
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECTF--
-Entry .phar/stub.php does not exist
-Entry .phar/alias.txt does not exist
-Cannot set stub ".phar/stub.php" directly in phar "%sphar_offset_check.phar.php", use setStub
+BadMethodCallException: Entry .phar/stub.php does not exist
+BadMethodCallException: Entry .phar/alias.txt does not exist
+BadMethodCallException: Cannot set stub ".phar/stub.php" directly in phar "%sphar_offset_check.phar.php", use setStub
int(6661)
int(6661)
-Cannot set alias ".phar/alias.txt" directly in phar "%sphar_offset_check.phar.php", use setAlias
+BadMethodCallException: Cannot set alias ".phar/alias.txt" directly in phar "%sphar_offset_check.phar.php", use setAlias
string(5) "susan"
string(5) "susan"
diff --git a/ext/phar/tests/phar_offset_get_error.phpt b/ext/phar/tests/phar_offset_get_error.phpt
index b97971f8c3e..aa33ab5bd43 100644
--- a/ext/phar/tests/phar_offset_get_error.phpt
+++ b/ext/phar/tests/phar_offset_get_error.phpt
@@ -22,7 +22,7 @@
}
catch(Exception $e)
{
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
include($pname . $iname);
@@ -31,18 +31,18 @@
try {
$p['.phar/oops'] = 'hi';
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = $p['.phar/stub.php'];
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
--EXPECT--
-Entry /error/.. does not exist and cannot be created: phar error: invalid path "/error/.." contains upper directory reference
+BadMethodCallException: Entry /error/.. does not exist and cannot be created: phar error: invalid path "/error/.." contains upper directory reference
foobar
-Cannot set any files or directories in magic ".phar" directory
-Entry .phar/stub.php does not exist
+BadMethodCallException: Cannot set any files or directories in magic ".phar" directory
+BadMethodCallException: Entry .phar/stub.php does not exist
diff --git a/ext/phar/tests/phar_oo_001.phpt b/ext/phar/tests/phar_oo_001.phpt
index e30d112109f..7cde23fcf73 100644
--- a/ext/phar/tests/phar_oo_001.phpt
+++ b/ext/phar/tests/phar_oo_001.phpt
@@ -28,14 +28,14 @@ function __construct()
}
catch (LogicException $e)
{
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar = new Phar('test.phar');
$phar->__construct('oops');
} catch (LogicException $e)
{
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -47,5 +47,5 @@ function __construct()
--EXPECT--
string(5) "1.0.0"
int(5)
-string(50) "Cannot call method on an uninitialized Phar object"
-string(29) "Cannot call constructor twice"
+BadMethodCallException: Cannot call method on an uninitialized Phar object
+BadMethodCallException: Cannot call constructor twice
diff --git a/ext/phar/tests/phar_oo_006.phpt b/ext/phar/tests/phar_oo_006.phpt
index a21f8188415..627da36d5bc 100644
--- a/ext/phar/tests/phar_oo_006.phpt
+++ b/ext/phar/tests/phar_oo_006.phpt
@@ -25,7 +25,7 @@ function __construct($what)
}
catch (TypeError $e)
{
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$phar->setInfoClass('MyFile');
@@ -40,7 +40,7 @@ function __construct($what)
__halt_compiler();
?>
--EXPECTF--
-SplFileInfo::setFileClass(): Argument #1 ($class) must be a class name derived from SplFileObject, SplFileInfo given
+TypeError: SplFileInfo::setFileClass(): Argument #1 ($class) must be a class name derived from SplFileObject, SplFileInfo given
MyFile::__construct(phar://%s/a.php)
a.php
MyFile::__construct(phar://%s/b/c.php)
diff --git a/ext/phar/tests/phar_oo_011b.phpt b/ext/phar/tests/phar_oo_011b.phpt
index 44677732cfb..e4841f55fe7 100644
--- a/ext/phar/tests/phar_oo_011b.phpt
+++ b/ext/phar/tests/phar_oo_011b.phpt
@@ -23,7 +23,7 @@
}
catch (BadMethodCallException $e)
{
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -33,4 +33,4 @@
__halt_compiler();
?>
--EXPECT--
-Exception: Write operations disabled by the php.ini setting phar.readonly
+BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly
diff --git a/ext/phar/tests/phar_oo_012b.phpt b/ext/phar/tests/phar_oo_012b.phpt
index 296d2e04f89..5b1daa182cc 100644
--- a/ext/phar/tests/phar_oo_012b.phpt
+++ b/ext/phar/tests/phar_oo_012b.phpt
@@ -26,7 +26,7 @@
}
catch (BadMethodCallException $e)
{
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -36,4 +36,4 @@
__halt_compiler();
?>
--EXPECT--
-Exception: Write operations disabled by the php.ini setting phar.readonly
+BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly
diff --git a/ext/phar/tests/phar_oo_compressallgz.phpt b/ext/phar/tests/phar_oo_compressallgz.phpt
index c0b8ea9da2d..b634eff0969 100644
--- a/ext/phar/tests/phar_oo_compressallgz.phpt
+++ b/ext/phar/tests/phar_oo_compressallgz.phpt
@@ -42,7 +42,7 @@
try {
$phar->compressFiles(25);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -65,4 +65,4 @@
string(1) "c"
bool(true)
bool(false)
-Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2
+BadMethodCallException: Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2
diff --git a/ext/phar/tests/phar_oo_getcontents.phpt b/ext/phar/tests/phar_oo_getcontents.phpt
index 7883610ff7f..2e360f3607c 100644
--- a/ext/phar/tests/phar_oo_getcontents.phpt
+++ b/ext/phar/tests/phar_oo_getcontents.phpt
@@ -16,12 +16,12 @@
try {
echo $phar['a']->getContent(), "\n";
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo $phar['hi']->getContent(), "\n";
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -32,5 +32,5 @@
--EXPECTF--
file contents
this works
-phar error: Cannot retrieve contents, "a" in phar "%sphar_oo_getcontents.phar.php" is a directory
-phar error: Cannot retrieve contents, "hi" in phar "%sphar_oo_getcontents.phar.php" is a directory
+BadMethodCallException: phar error: Cannot retrieve contents, "a" in phar "%sphar_oo_getcontents.phar.php" is a directory
+BadMethodCallException: phar error: Cannot retrieve contents, "hi" in phar "%sphar_oo_getcontents.phar.php" is a directory
diff --git a/ext/phar/tests/phar_setalias2.phpt b/ext/phar/tests/phar_setalias2.phpt
index 7944af8330b..d1d5fbd8268 100644
--- a/ext/phar/tests/phar_setalias2.phpt
+++ b/ext/phar/tests/phar_setalias2.phpt
@@ -27,12 +27,12 @@
try {
$phar->setAlias('test');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b = new Phar(__DIR__ . '/nope.phar', 0, 'test');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -42,5 +42,5 @@
--EXPECTF--
hio
test
-alias "test" is already used for archive "%sphar_setalias2.phar.php" and cannot be used for other archives
-alias "test" is already used for archive "%sphar_setalias2.phar.php" cannot be overloaded with "%snope.phar"
+PharException: alias "test" is already used for archive "%sphar_setalias2.phar.php" and cannot be used for other archives
+UnexpectedValueException: alias "test" is already used for archive "%sphar_setalias2.phar.php" cannot be overloaded with "%snope.phar"
diff --git a/ext/phar/tests/phar_setdefaultstub.phpt b/ext/phar/tests/phar_setdefaultstub.phpt
index ea05a03bc1a..f736de25314 100644
--- a/ext/phar/tests/phar_setdefaultstub.phpt
+++ b/ext/phar/tests/phar_setdefaultstub.phpt
@@ -44,7 +44,7 @@
var_dump(strlen($phar->getStub()));
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -957,4 +957,4 @@ static function _removeTmpFiles($temp, $origdir)
============================================================================
============================================================================
int(7052)
-Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
+UnexpectedValueException: Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
diff --git a/ext/phar/tests/phar_stub.phpt b/ext/phar/tests/phar_stub.phpt
index 0ede5f011e1..98b36ad1e5e 100644
--- a/ext/phar/tests/phar_stub.phpt
+++ b/ext/phar/tests/phar_stub.phpt
@@ -61,7 +61,7 @@
try {
$phar->setStub($fp);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
set_error_handler(null);
fclose($fp);
@@ -106,7 +106,7 @@
Deprecated: Calling Phar::setStub(resource $stub, int $length) is deprecated in %s on line %d
<?php echo "third stub\n"; __HALT_COMPILER(); ?>
<?php echo "third stub\n"; __HALT_COMPILER(); ?>booya
-Calling Phar::setStub(resource $stub, int $length) is deprecated
+Exception: Calling Phar::setStub(resource $stub, int $length) is deprecated
<?php echo "third stub\n"; __HALT_COMPILER(); ?>
Deprecated: Calling Phar::setStub(resource $stub, int $length) is deprecated in %s on line %d
diff --git a/ext/phar/tests/phar_stub_error.phpt b/ext/phar/tests/phar_stub_error.phpt
index 9515e8675a4..ed5afc3beda 100644
--- a/ext/phar/tests/phar_stub_error.phpt
+++ b/ext/phar/tests/phar_stub_error.phpt
@@ -29,7 +29,7 @@
}
catch(exception $e)
{
- echo 'Exception: ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
var_dump($phar->getStub() == $stub);
@@ -47,7 +47,7 @@
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
bool(true)
-Exception: illegal stub for phar "%sphar_stub_error.phar.php" (__HALT_COMPILER(); is missing)
+PharException: illegal stub for phar "%sphar_stub_error.phar.php" (__HALT_COMPILER(); is missing)
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
bool(true)
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
diff --git a/ext/phar/tests/phar_unlinkarchive.phpt b/ext/phar/tests/phar_unlinkarchive.phpt
index c76669be17b..729c48c69c3 100644
--- a/ext/phar/tests/phar_unlinkarchive.phpt
+++ b/ext/phar/tests/phar_unlinkarchive.phpt
@@ -11,7 +11,7 @@
try {
Phar::unlinkArchive("");
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar';
@@ -20,18 +20,18 @@
try {
Phar::unlinkArchive($fname);
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
file_put_contents($pdname, 'blahblah');
try {
Phar::unlinkArchive($pdname);
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Phar::unlinkArchive(array());
} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$pname = 'phar://' . $fname;
@@ -53,7 +53,7 @@
try {
Phar::unlinkArchive($fname);
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
$phar = $phar->convertToExecutable(Phar::ZIP);
var_dump($phar->isFileFormat(Phar::ZIP));
@@ -89,13 +89,13 @@
__HALT_COMPILER();
?>
--EXPECTF--
-Unknown phar archive ""
-Unknown phar archive "%sphar_unlinkarchive.phar"
-Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry)
-Phar::unlinkArchive(): Argument #1 ($filename) must be of type string, array given
+PharException: Unknown phar archive ""
+PharException: Unknown phar archive "%sphar_unlinkarchive.phar"
+PharException: Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry)
+TypeError: Phar::unlinkArchive(): Argument #1 ($filename) must be of type string, array given
bool(false)
string(48) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>"
-phar archive "%sphar_unlinkarchive.phar" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()
+PharException: phar archive "%sphar_unlinkarchive.phar" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive()
bool(true)
string(60) "<?php // zip-based phar archive stub file
__HALT_COMPILER();"
diff --git a/ext/phar/tests/pharfileinfo_chmod.phpt b/ext/phar/tests/pharfileinfo_chmod.phpt
index f35af675c71..339246f23ad 100644
--- a/ext/phar/tests/pharfileinfo_chmod.phpt
+++ b/ext/phar/tests/pharfileinfo_chmod.phpt
@@ -17,7 +17,7 @@
try {
$phar['a']->chmod(066);
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
lstat($pname . '/a/b'); // sets BG(CurrentLStatFile)
$b->chmod(0666);
@@ -25,4 +25,4 @@
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
--EXPECT--
-Phar entry "a" is a temporary directory (not an actual entry in the archive), cannot chmod
+BadMethodCallException: Phar entry "a" is a temporary directory (not an actual entry in the archive), cannot chmod
diff --git a/ext/phar/tests/pharfileinfo_compression.phpt b/ext/phar/tests/pharfileinfo_compression.phpt
index ec016cc9d2b..7f15aee233c 100644
--- a/ext/phar/tests/pharfileinfo_compression.phpt
+++ b/ext/phar/tests/pharfileinfo_compression.phpt
@@ -20,12 +20,12 @@
try {
$b->isCompressed(25);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b->compress(25);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
$tar = $phar->convertToData(Phar::TAR);
@@ -33,18 +33,18 @@
try {
$c->compress(Phar::GZ);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar['a']->compress(Phar::GZ);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 1);
try {
$b->compress(Phar::GZ);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 0);
var_dump($b->compress(Phar::GZ));
@@ -58,13 +58,13 @@
try {
$phar['a/b']->decompress();
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 0);
try {
$phar['a']->decompress();
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($b->decompress());
var_dump($b->decompress());
@@ -74,17 +74,17 @@
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?>
--EXPECT--
-Unknown compression type specified
-Unknown compression type specified
-Cannot compress with Gzip compression, not possible with tar-based phar archives
-Phar entry is a directory, cannot set compression
-Phar is readonly, cannot change compression
+BadMethodCallException: Unknown compression type specified
+BadMethodCallException: Unknown compression type specified
+BadMethodCallException: Cannot compress with Gzip compression, not possible with tar-based phar archives
+BadMethodCallException: Phar entry is a directory, cannot set compression
+BadMethodCallException: Phar is readonly, cannot change compression
bool(true)
bool(true)
bool(true)
bool(true)
decompress
-Phar is readonly, cannot decompress
-Phar entry is a directory, cannot set compression
+BadMethodCallException: Phar is readonly, cannot decompress
+BadMethodCallException: Phar entry is a directory, cannot set compression
bool(true)
bool(true)
diff --git a/ext/phar/tests/pharfileinfo_construct.phpt b/ext/phar/tests/pharfileinfo_construct.phpt
index 4839b8ebf8b..8b8ad6761fa 100644
--- a/ext/phar/tests/pharfileinfo_construct.phpt
+++ b/ext/phar/tests/pharfileinfo_construct.phpt
@@ -13,14 +13,14 @@
file_put_contents($fname, 'blah');
$a = new PharFileInfo($pname . '/oops');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
unlink($fname);
}
try {
$a = new PharFileInfo(array());
} catch (TypeError $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
$a = new Phar($fname);
@@ -30,26 +30,26 @@
try {
$a = new PharFileInfo($pname . '/oops/I/do/not/exist');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b->__construct('oops');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = new PharFileInfo(__FILE__);
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
--EXPECTF--
-Cannot open phar file 'phar://%spharfileinfo_construct.phar/oops': internal corruption of phar "%spharfileinfo_construct.phar" (truncated entry)
-PharFileInfo::__construct(): Argument #1 ($filename) must be of type string, array given
-Cannot access phar file entry '%s' in archive '%s'
-Cannot call constructor twice
-'%s' is not a valid phar archive URL (must have at least phar://filename.phar)
+RuntimeException: Cannot open phar file 'phar://%spharfileinfo_construct.phar/oops': internal corruption of phar "%spharfileinfo_construct.phar" (truncated entry)
+TypeError: PharFileInfo::__construct(): Argument #1 ($filename) must be of type string, array given
+RuntimeException: Cannot access phar file entry '%s' in archive '%s'
+BadMethodCallException: Cannot call constructor twice
+RuntimeException: '%s' is not a valid phar archive URL (must have at least phar://filename.phar)
diff --git a/ext/phar/tests/pharfileinfo_getcrc32.phpt b/ext/phar/tests/pharfileinfo_getcrc32.phpt
index e9c682317c8..5ced6b1beed 100644
--- a/ext/phar/tests/pharfileinfo_getcrc32.phpt
+++ b/ext/phar/tests/pharfileinfo_getcrc32.phpt
@@ -23,25 +23,25 @@
try {
var_dump($b->getCRC32());
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
$b = new PharFileInfo($pname . '/a/subdir/here');
try {
var_dump($b->getCRC32());
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
$a = file_get_contents($pname . '/a/subdir/here');
try {
var_dump($b->getCRC32());
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
--EXPECTF--
-Phar entry is a directory, does not have a CRC
-Phar entry was not CRC checked
+BadMethodCallException: Phar entry is a directory, does not have a CRC
+BadMethodCallException: Phar entry was not CRC checked
int(%s)
diff --git a/ext/phar/tests/pharfileinfo_setmetadata.phpt b/ext/phar/tests/pharfileinfo_setmetadata.phpt
index 46990f46f14..cb0790ae29f 100644
--- a/ext/phar/tests/pharfileinfo_setmetadata.phpt
+++ b/ext/phar/tests/pharfileinfo_setmetadata.phpt
@@ -18,30 +18,30 @@
try {
$phar['a']->setMetadata('hi');
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar['a']->delMetadata();
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly', 1);
try {
$b->setMetadata('hi');
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b->delMetadata();
} catch (Exception $e) {
-echo $e->getMessage(), "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?>
--EXPECT--
-Phar entry is a temporary directory (not an actual entry in the archive), cannot set metadata
-Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata
-Write operations disabled by the php.ini setting phar.readonly
-Write operations disabled by the php.ini setting phar.readonly
+BadMethodCallException: Phar entry is a temporary directory (not an actual entry in the archive), cannot set metadata
+BadMethodCallException: Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata
+BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly
+BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly
diff --git a/ext/phar/tests/tar/033.phpt b/ext/phar/tests/tar/033.phpt
index f13121951fe..7f55168d0dc 100644
--- a/ext/phar/tests/tar/033.phpt
+++ b/ext/phar/tests/tar/033.phpt
@@ -36,7 +36,7 @@
$phar['test']->chmod(0666);
var_dump($phar['test']->isReadable());
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/ext/phar/tests/tar/033a.phpt b/ext/phar/tests/tar/033a.phpt
index f0f3faf58e0..ba442bcb31d 100644
--- a/ext/phar/tests/tar/033a.phpt
+++ b/ext/phar/tests/tar/033a.phpt
@@ -37,7 +37,7 @@
$phar['test']->chmod(0666);
var_dump($phar['test']->isReadable());
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -46,4 +46,4 @@
?>
--EXPECTF--
bool(false)
-Cannot modify permissions for file "a.php" in phar "%s033a.phar.tar", write operations are prohibited
+PharException: Cannot modify permissions for file "a.php" in phar "%s033a.phar.tar", write operations are prohibited
diff --git a/ext/phar/tests/tar/alias_acrobatics.phpt b/ext/phar/tests/tar/alias_acrobatics.phpt
index c3d9134a5a4..5e532ad3923 100644
--- a/ext/phar/tests/tar/alias_acrobatics.phpt
+++ b/ext/phar/tests/tar/alias_acrobatics.phpt
@@ -17,19 +17,19 @@
try {
$a = new Phar($fname2, 0, 'foo');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
copy($fname, $fname2);
echo "2\n";
try {
$a = new Phar($fname2);
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b = new Phar($fname, 0, 'another');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -38,7 +38,7 @@
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.tar');
?>
--EXPECTF--
-alias "foo" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.2.phar.tar"
+UnexpectedValueException: alias "foo" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.2.phar.tar"
2
-phar error: Unable to add tar-based phar "%salias_acrobatics.2.phar.tar", alias is already in use
-alias "another" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.phar.tar"
+UnexpectedValueException: phar error: Unable to add tar-based phar "%salias_acrobatics.2.phar.tar", alias is already in use
+UnexpectedValueException: alias "another" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.phar.tar"
diff --git a/ext/phar/tests/tar/badalias.phpt b/ext/phar/tests/tar/badalias.phpt
index a660192e95b..b876e70314b 100644
--- a/ext/phar/tests/tar/badalias.phpt
+++ b/ext/phar/tests/tar/badalias.phpt
@@ -11,13 +11,13 @@
try {
new Phar($e . "badalias$i.phar.tar");
} catch (Exception $ee) {
-echo $ee->getMessage(), "\n";
+echo $ee::class, ': ', $ee->getMessage(), "\n";
}
}
?>
--EXPECTF--
-phar error: invalid alias "hi/thereaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." in tar-based phar "%sbadalias1.phar.tar"
-phar error: invalid alias "hi\there" in tar-based phar "%sbadalias2.phar.tar"
-phar error: invalid alias "hi;there" in tar-based phar "%sbadalias3.phar.tar"
-phar error: invalid alias "hi:there" in tar-based phar "%sbadalias4.phar.tar"
-phar error: tar-based phar "%sbadalias5.phar.tar" has alias that is larger than 511 bytes, cannot process
+UnexpectedValueException: phar error: invalid alias "hi/thereaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." in tar-based phar "%sbadalias1.phar.tar"
+UnexpectedValueException: phar error: invalid alias "hi\there" in tar-based phar "%sbadalias2.phar.tar"
+UnexpectedValueException: phar error: invalid alias "hi;there" in tar-based phar "%sbadalias3.phar.tar"
+UnexpectedValueException: phar error: invalid alias "hi:there" in tar-based phar "%sbadalias4.phar.tar"
+UnexpectedValueException: phar error: tar-based phar "%sbadalias5.phar.tar" has alias that is larger than 511 bytes, cannot process
diff --git a/ext/phar/tests/tar/badchecksum.phpt b/ext/phar/tests/tar/badchecksum.phpt
index be74dd531c2..ffb4ec4f9ce 100644
--- a/ext/phar/tests/tar/badchecksum.phpt
+++ b/ext/phar/tests/tar/badchecksum.phpt
@@ -16,7 +16,7 @@
try {
$p = new PharData($fname);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -25,4 +25,4 @@
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar');
?>
--EXPECTF--
-phar error: "%sbadchecksum.tar" is a corrupted tar file (checksum mismatch of file "hithere")
+UnexpectedValueException: phar error: "%sbadchecksum.tar" is a corrupted tar file (checksum mismatch of file "hithere")
diff --git a/ext/phar/tests/tar/bignames.phpt b/ext/phar/tests/tar/bignames.phpt
index 0c5d3cbca71..135265d9544 100644
--- a/ext/phar/tests/tar/bignames.phpt
+++ b/ext/phar/tests/tar/bignames.phpt
@@ -23,21 +23,21 @@
try {
$p2[str_repeat('a', 400)] = 'yuck';
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p2 = new PharData($fname3);
$p2[str_repeat('a', 101)] = 'yuck';
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p2 = new PharData($fname4);
$p2[str_repeat('b', 160) . '/' . str_repeat('a', 90)] = 'yuck';
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -50,6 +50,6 @@
--EXPECTF--
hi
hi2
-tar-based phar "%sbignames.2.tar" cannot be created, filename "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format
-tar-based phar "%sbignames.3.tar" cannot be created, filename "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format
-tar-based phar "%sbignames.4.tar" cannot be created, filename "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format
+PharException: tar-based phar "%sbignames.2.tar" cannot be created, filename "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format
+PharException: tar-based phar "%sbignames.3.tar" cannot be created, filename "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format
+PharException: tar-based phar "%sbignames.4.tar" cannot be created, filename "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format
diff --git a/ext/phar/tests/tar/bug71317-duplicate-filename.phpt b/ext/phar/tests/tar/bug71317-duplicate-filename.phpt
index 1e45789d6db..0e7d26dbdb4 100644
--- a/ext/phar/tests/tar/bug71317-duplicate-filename.phpt
+++ b/ext/phar/tests/tar/bug71317-duplicate-filename.phpt
@@ -32,7 +32,7 @@
throw new Exception(sprintf('Contents of file2.txt ("%s") is invalid, expected "%s"', $fileContent, $expectedContent));
}
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
===DONE===
diff --git a/ext/phar/tests/tar/bug71504.phpt b/ext/phar/tests/tar/bug71504.phpt
index bf1627a7121..33332bea410 100644
--- a/ext/phar/tests/tar/bug71504.phpt
+++ b/ext/phar/tests/tar/bug71504.phpt
@@ -9,7 +9,7 @@
try {
$tar = new PharData($fname);
} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
===DONE===
diff --git a/ext/phar/tests/tar/create_new_phar_b.phpt b/ext/phar/tests/tar/create_new_phar_b.phpt
index 2c09c0470cd..c67f99d2ea2 100644
--- a/ext/phar/tests/tar/create_new_phar_b.phpt
+++ b/ext/phar/tests/tar/create_new_phar_b.phpt
@@ -18,4 +18,3 @@
Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d
Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.tar/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d
-
diff --git a/ext/phar/tests/tar/delete_in_phar.phpt b/ext/phar/tests/tar/delete_in_phar.phpt
index 79aeeba0d0f..5f05481850f 100644
--- a/ext/phar/tests/tar/delete_in_phar.phpt
+++ b/ext/phar/tests/tar/delete_in_phar.phpt
@@ -45,4 +45,3 @@
Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.tar" in %sdelete_in_phar.php on line %d
Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.tar/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d
-
diff --git a/ext/phar/tests/tar/delete_in_phar_b.phpt b/ext/phar/tests/tar/delete_in_phar_b.phpt
index 812a43755b2..a1c4f3be9cb 100644
--- a/ext/phar/tests/tar/delete_in_phar_b.phpt
+++ b/ext/phar/tests/tar/delete_in_phar_b.phpt
@@ -44,4 +44,3 @@
This is a
This is b
This is b/c
-
diff --git a/ext/phar/tests/tar/delete_in_phar_confirm.phpt b/ext/phar/tests/tar/delete_in_phar_confirm.phpt
index cdd08441e86..0a1ca676be1 100644
--- a/ext/phar/tests/tar/delete_in_phar_confirm.phpt
+++ b/ext/phar/tests/tar/delete_in_phar_confirm.phpt
@@ -48,4 +48,3 @@
Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.tar" in %sdelete_in_phar_confirm.php on line %d
Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.tar/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d
-
diff --git a/ext/phar/tests/tar/exists_as_phar.phpt b/ext/phar/tests/tar/exists_as_phar.phpt
index 9007d73e5fa..c2d6cb8a3d8 100644
--- a/ext/phar/tests/tar/exists_as_phar.phpt
+++ b/ext/phar/tests/tar/exists_as_phar.phpt
@@ -23,7 +23,7 @@
try {
$p = new Phar($tname);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -33,4 +33,4 @@
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');
?>
--EXPECTF--
-phar tar error: "%sexists_as_phar.phar.tar" already exists as a regular phar and must be deleted from disk prior to creating as a tar-based phar
+UnexpectedValueException: phar tar error: "%sexists_as_phar.phar.tar" already exists as a regular phar and must be deleted from disk prior to creating as a tar-based phar
diff --git a/ext/phar/tests/tar/links.phpt b/ext/phar/tests/tar/links.phpt
index cde880a7401..21034f9c6a5 100644
--- a/ext/phar/tests/tar/links.phpt
+++ b/ext/phar/tests/tar/links.phpt
@@ -11,7 +11,7 @@
try {
$p = new PharData($fname);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($p['testit/link']->getContent());
var_dump($p['testit/hard']->getContent());
diff --git a/ext/phar/tests/tar/links2.phpt b/ext/phar/tests/tar/links2.phpt
index 9d0292e7101..70b8d935227 100644
--- a/ext/phar/tests/tar/links2.phpt
+++ b/ext/phar/tests/tar/links2.phpt
@@ -22,7 +22,7 @@
try {
$p = new PharData($fname);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -30,4 +30,4 @@
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar');
?>
--EXPECTF--
-phar error: "%slinks2.tar" is a corrupted tar file - hard link to non-existent file "internal/file.txt"
+UnexpectedValueException: phar error: "%slinks2.tar" is a corrupted tar file - hard link to non-existent file "internal/file.txt"
diff --git a/ext/phar/tests/tar/links3.phpt b/ext/phar/tests/tar/links3.phpt
index a887f5046f3..93f9598328a 100644
--- a/ext/phar/tests/tar/links3.phpt
+++ b/ext/phar/tests/tar/links3.phpt
@@ -9,7 +9,7 @@
try {
$p = new PharData(__DIR__ . '/files/biglink.tar');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo $p['file.txt']->getContent();
echo $p['my/file']->getContent();
diff --git a/ext/phar/tests/tar/links4.phpt b/ext/phar/tests/tar/links4.phpt
index aa026e6e1ea..912356428e3 100644
--- a/ext/phar/tests/tar/links4.phpt
+++ b/ext/phar/tests/tar/links4.phpt
@@ -9,7 +9,7 @@
try {
$p = new PharData(__DIR__ . '/files/tinylink.tar');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo $p['file.txt']->getContent();
echo $p['link.txt']->getContent();
diff --git a/ext/phar/tests/tar/links5.phpt b/ext/phar/tests/tar/links5.phpt
index 05ab8ce53f9..00fe4429515 100644
--- a/ext/phar/tests/tar/links5.phpt
+++ b/ext/phar/tests/tar/links5.phpt
@@ -9,7 +9,7 @@
try {
$p = new PharData(__DIR__ . '/files/subdirlink.tar');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo $p['hi/test.txt']->getContent();
echo $p['hi/link.txt']->getContent();
diff --git a/ext/phar/tests/tar/links6.phpt b/ext/phar/tests/tar/links6.phpt
index 614c3bd66e5..adb0c1adaed 100644
--- a/ext/phar/tests/tar/links6.phpt
+++ b/ext/phar/tests/tar/links6.phpt
@@ -22,4 +22,3 @@
hi there
there
-
diff --git a/ext/phar/tests/tar/open_for_write_existing_b.phpt b/ext/phar/tests/tar/open_for_write_existing_b.phpt
index b8afb8b21c0..53d95b3b497 100644
--- a/ext/phar/tests/tar/open_for_write_existing_b.phpt
+++ b/ext/phar/tests/tar/open_for_write_existing_b.phpt
@@ -39,4 +39,3 @@
Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d
bool(false)
This is b/c
-
diff --git a/ext/phar/tests/tar/open_for_write_existing_c.phpt b/ext/phar/tests/tar/open_for_write_existing_c.phpt
index 0cba841f2d8..677797ed1a1 100644
--- a/ext/phar/tests/tar/open_for_write_existing_c.phpt
+++ b/ext/phar/tests/tar/open_for_write_existing_c.phpt
@@ -39,4 +39,3 @@
Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d
bool(false)
This is b/c
-
diff --git a/ext/phar/tests/tar/open_for_write_newfile_b.phpt b/ext/phar/tests/tar/open_for_write_newfile_b.phpt
index 794d02d8acf..7ca3831b11c 100644
--- a/ext/phar/tests/tar/open_for_write_newfile_b.phpt
+++ b/ext/phar/tests/tar/open_for_write_newfile_b.phpt
@@ -44,4 +44,3 @@
Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.tar" in %sopen_for_write_newfile_b.php on line %d
Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d
-
diff --git a/ext/phar/tests/tar/open_for_write_newfile_c.phpt b/ext/phar/tests/tar/open_for_write_newfile_c.phpt
index 13c80ec857a..5f92fa7e9d2 100644
--- a/ext/phar/tests/tar/open_for_write_newfile_c.phpt
+++ b/ext/phar/tests/tar/open_for_write_newfile_c.phpt
@@ -43,4 +43,3 @@
Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.tar" in %sopen_for_write_newfile_c.php on line %d
Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d
-
diff --git a/ext/phar/tests/tar/phar_buildfromiterator5.phpt b/ext/phar/tests/tar/phar_buildfromiterator5.phpt
index 6a81c1df65d..89b62ed0c92 100644
--- a/ext/phar/tests/tar/phar_buildfromiterator5.phpt
+++ b/ext/phar/tests/tar/phar_buildfromiterator5.phpt
@@ -40,13 +40,11 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator.phar.tar');
var_dump($phar->buildFromIterator(new myIterator(array('a' => new stdClass))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
rewind
valid
current
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)
+UnexpectedValueException: Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)
diff --git a/ext/phar/tests/tar/phar_buildfromiterator6.phpt b/ext/phar/tests/tar/phar_buildfromiterator6.phpt
index 91820369799..0408c0be611 100644
--- a/ext/phar/tests/tar/phar_buildfromiterator6.phpt
+++ b/ext/phar/tests/tar/phar_buildfromiterator6.phpt
@@ -40,8 +40,7 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator.phar.tar');
var_dump($phar->buildFromIterator(new myIterator(array(basename(__FILE__, 'php') . 'phpt'))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -49,5 +48,4 @@ function rewind(): void {
valid
current
key
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned an invalid key (must return a string)
+UnexpectedValueException: Iterator myIterator returned an invalid key (must return a string)
diff --git a/ext/phar/tests/tar/phar_buildfromiterator7.phpt b/ext/phar/tests/tar/phar_buildfromiterator7.phpt
index 297b40b5eed..8549a182ea1 100644
--- a/ext/phar/tests/tar/phar_buildfromiterator7.phpt
+++ b/ext/phar/tests/tar/phar_buildfromiterator7.phpt
@@ -40,8 +40,7 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator.phar.tar');
var_dump($phar->buildFromIterator(new myIterator(array('a' => basename(__FILE__, 'php') . '/oopsie/there.phpt'))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -49,5 +48,4 @@ function rewind(): void {
valid
current
key
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
+UnexpectedValueException: Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
diff --git a/ext/phar/tests/tar/phar_copy.phpt b/ext/phar/tests/tar/phar_copy.phpt
index 52b42b6c46e..4fb1686699d 100644
--- a/ext/phar/tests/tar/phar_copy.phpt
+++ b/ext/phar/tests/tar/phar_copy.phpt
@@ -33,7 +33,7 @@
}
catch(Exception $e)
{
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly',1);
$p2 = new Phar($fname2);
@@ -49,7 +49,7 @@
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '2.phar.php'); ?>
--EXPECTF--
hihibool(true)
-file "/error/.." contains invalid characters upper directory reference, cannot be copied from "a" in phar %s
+UnexpectedValueException: file "/error/.." contains invalid characters upper directory reference, cannot be copied from "a" in phar %s
bool(true)
a: hib: hic: hi===DONE===
diff --git a/ext/phar/tests/tar/phar_setalias2.phpt b/ext/phar/tests/tar/phar_setalias2.phpt
index 31df9ae59aa..cc82ec4456f 100644
--- a/ext/phar/tests/tar/phar_setalias2.phpt
+++ b/ext/phar/tests/tar/phar_setalias2.phpt
@@ -35,7 +35,7 @@
try {
$phar->setAlias('test');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -46,4 +46,4 @@
--EXPECTF--
hio
test
-alias "test" is already used for archive "%sphar_setalias2.phar.tar" and cannot be used for other archives
+PharException: alias "test" is already used for archive "%sphar_setalias2.phar.tar" and cannot be used for other archives
diff --git a/ext/phar/tests/tar/phar_setdefaultstub.phpt b/ext/phar/tests/tar/phar_setdefaultstub.phpt
index ffb1887c233..8ce1f12943d 100644
--- a/ext/phar/tests/tar/phar_setdefaultstub.phpt
+++ b/ext/phar/tests/tar/phar_setdefaultstub.phpt
@@ -23,7 +23,7 @@
$phar->setDefaultStub();
$phar->stopBuffering();
} catch(Exception $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
@@ -34,13 +34,13 @@
try {
$phar->setDefaultStub('my/custom/thingy.php');
} catch(ValueError $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->stopBuffering();
} catch(Exception $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
@@ -51,13 +51,13 @@
try {
$phar->setDefaultStub('my/custom/thingy.php', 'the/web.php');
} catch(ValueError $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->stopBuffering();
} catch(Exception $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
@@ -76,11 +76,11 @@
__HALT_COMPILER();"
============================================================================
============================================================================
-Phar::setDefaultStub(): Argument #1 ($index) must be null for a tar- or zip-based phar stub, string given
+ValueError: Phar::setDefaultStub(): Argument #1 ($index) must be null for a tar- or zip-based phar stub, string given
string(60) "<?php // tar-based phar archive stub file
__HALT_COMPILER();"
============================================================================
============================================================================
-Phar::setDefaultStub(): Argument #1 ($index) must be null for a tar- or zip-based phar stub, string given
+ValueError: Phar::setDefaultStub(): Argument #1 ($index) must be null for a tar- or zip-based phar stub, string given
string(60) "<?php // tar-based phar archive stub file
__HALT_COMPILER();"
diff --git a/ext/phar/tests/tar/phar_stub_error.phpt b/ext/phar/tests/tar/phar_stub_error.phpt
index 2cfeb4d43fa..5ae893dfec8 100644
--- a/ext/phar/tests/tar/phar_stub_error.phpt
+++ b/ext/phar/tests/tar/phar_stub_error.phpt
@@ -25,7 +25,7 @@
try {
$phar->setStub($newstub);
} catch(exception $e) {
- echo 'Exception: ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
@@ -44,7 +44,7 @@
string(50) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>
"
bool(true)
-Exception: illegal stub for tar-based phar "%sphar_stub_error.phar.tar"
+PharException: illegal stub for tar-based phar "%sphar_stub_error.phar.tar"
string(50) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>
"
bool(true)
diff --git a/ext/phar/tests/tar/require_hash.phpt b/ext/phar/tests/tar/require_hash.phpt
index f3463343b48..cd41d84fc6d 100644
--- a/ext/phar/tests/tar/require_hash.phpt
+++ b/ext/phar/tests/tar/require_hash.phpt
@@ -24,7 +24,7 @@
$phar = new Phar($fname);
var_dump($phar->getStub());
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.require_hash', 0);
try {
@@ -34,7 +34,7 @@
$phar->setSignatureAlgorithm(Phar::MD5);
var_dump($phar->getSignature());
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -44,7 +44,7 @@
@unlink(__DIR__ . '/require_hash.tar');
?>
--EXPECTF--
-tar-based phar "%srequire_hash.phar.tar" does not have a signature
+UnexpectedValueException: tar-based phar "%srequire_hash.phar.tar" does not have a signature
bool(false)
array(2) {
["hash"]=>
diff --git a/ext/phar/tests/tar/tar_001.phpt b/ext/phar/tests/tar/tar_001.phpt
index 2ddeae188e4..53f0e3189ee 100644
--- a/ext/phar/tests/tar/tar_001.phpt
+++ b/ext/phar/tests/tar/tar_001.phpt
@@ -16,7 +16,7 @@
$phar = new Phar(__DIR__ . '/tar_001.phar.tar');
echo "should not execute\n";
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -25,4 +25,4 @@
?>
--EXPECTF--
Warning: fopen(): Failed to open stream: phar error: "%star_001.phar.tar" is a corrupted tar file (truncated) in %star_001.php on line 9
-phar error: "%star_001.phar.tar" is a corrupted tar file (truncated)
+UnexpectedValueException: phar error: "%star_001.phar.tar" is a corrupted tar file (truncated)
diff --git a/ext/phar/tests/tar/tar_002.phpt b/ext/phar/tests/tar/tar_002.phpt
index 12c7ec3bbcc..260b5fefd63 100644
--- a/ext/phar/tests/tar/tar_002.phpt
+++ b/ext/phar/tests/tar/tar_002.phpt
@@ -19,7 +19,7 @@
$phar = new Phar(__DIR__ . '/tar_002.phar.tar');
echo "should not execute\n";
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -28,4 +28,4 @@
?>
--EXPECTF--
Warning: fopen(): Failed to open stream: phar error: "%star_002.phar.tar" is a corrupted tar file (truncated) in %star_002.php on line 9
-phar error: "%star_002.phar.tar" is a corrupted tar file (truncated)
+UnexpectedValueException: phar error: "%star_002.phar.tar" is a corrupted tar file (truncated)
diff --git a/ext/phar/tests/tar/tar_003.phpt b/ext/phar/tests/tar/tar_003.phpt
index 388f8362a6a..a2c081cb010 100644
--- a/ext/phar/tests/tar/tar_003.phpt
+++ b/ext/phar/tests/tar/tar_003.phpt
@@ -28,7 +28,7 @@
try {
$tar = opendir($alias . '/');
} catch (Exception $e) {
-echo $e->getMessage()."\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
while (false !== ($v = readdir($tar))) {
diff --git a/ext/phar/tests/tar/tar_nohash.phpt b/ext/phar/tests/tar/tar_nohash.phpt
index eeec4411f45..579be240aab 100644
--- a/ext/phar/tests/tar/tar_nohash.phpt
+++ b/ext/phar/tests/tar/tar_nohash.phpt
@@ -12,7 +12,7 @@
$phar = new PharData(__DIR__ . '/files/Net_URL-1.0.15.tgz');
var_dump($phar->getStub());
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/ext/phar/tests/tar/tar_nostub.phpt b/ext/phar/tests/tar/tar_nostub.phpt
index 708354f82dc..c1da9455bb7 100644
--- a/ext/phar/tests/tar/tar_nostub.phpt
+++ b/ext/phar/tests/tar/tar_nostub.phpt
@@ -22,7 +22,7 @@
$phar = new Phar($fname);
var_dump($phar->getStub());
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
copy($fname, $fname2);
@@ -31,7 +31,7 @@
$phar = new PharData($fname2);
var_dump($phar->getStub());
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -41,6 +41,6 @@
@unlink(__DIR__ . '/tar_nostub.tar');
?>
--EXPECTF--
-RecursiveDirectoryIterator::__construct(): Failed to open directory: '%star_nostub.phar.tar' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive
+UnexpectedValueException: RecursiveDirectoryIterator::__construct(): Failed to open directory: '%star_nostub.phar.tar' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive
phar url "phar://%star_nostub.phar.tar/" is unknown
string(0) ""
diff --git a/ext/phar/tests/tar/tar_openssl_hash.phpt b/ext/phar/tests/tar/tar_openssl_hash.phpt
index f361440a140..eb8c8f214c3 100644
--- a/ext/phar/tests/tar/tar_openssl_hash.phpt
+++ b/ext/phar/tests/tar/tar_openssl_hash.phpt
@@ -12,7 +12,7 @@
try {
$phar = new PharData(__DIR__ . '/files/P1-1.0.0.tgz');
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/ext/phar/tests/tar/truncated.phpt b/ext/phar/tests/tar/truncated.phpt
index 95ed3c1c752..0284b294776 100644
--- a/ext/phar/tests/tar/truncated.phpt
+++ b/ext/phar/tests/tar/truncated.phpt
@@ -7,9 +7,9 @@
try {
$p = new PharData(__DIR__ . '/files/trunc.tar');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: "%strunc.tar" is a corrupted tar file (truncated)
+UnexpectedValueException: phar error: "%strunc.tar" is a corrupted tar file (truncated)
diff --git a/ext/phar/tests/test_alias_unset.phpt b/ext/phar/tests/test_alias_unset.phpt
index 0b332514a34..fcbc1a3fb24 100644
--- a/ext/phar/tests/test_alias_unset.phpt
+++ b/ext/phar/tests/test_alias_unset.phpt
@@ -25,7 +25,7 @@
try {
$phar2 = new Phar($fname2); // fails because references open to $fname
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
fclose($a);
$phar2 = new Phar($fname2); // succeeds because all refs are closed
@@ -37,7 +37,7 @@
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.php'); ?>
--EXPECTF--
-Cannot open archive "%stest_alias_unset.2.phar.php", alias is already in use by existing archive
+UnexpectedValueException: Cannot open archive "%stest_alias_unset.2.phar.php", alias is already in use by existing archive
string(5) "first"
Warning: file_get_contents(): Failed to open stream: Cannot open archive "%stest_alias_unset.phar.php", alias is already in use by existing archive in %stest_alias_unset.php on line %d
diff --git a/ext/phar/tests/test_unset.phpt b/ext/phar/tests/test_unset.phpt
index 8aa422cb072..ddc50598a8d 100644
--- a/ext/phar/tests/test_unset.phpt
+++ b/ext/phar/tests/test_unset.phpt
@@ -22,7 +22,7 @@
try {
$phar->setAlias('first');
} catch(Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$phar = new Phar($fname);
diff --git a/ext/phar/tests/webphar_compilefail.phpt b/ext/phar/tests/webphar_compilefail.phpt
index 0f6e38e260f..71e629b3cfe 100644
--- a/ext/phar/tests/webphar_compilefail.phpt
+++ b/ext/phar/tests/webphar_compilefail.phpt
@@ -9,9 +9,9 @@
try {
Phar::webPhar('oopsiedaisy.phar', '/index.php');
} catch (Exception $e) {
-echo $e->getMessage() . "\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
__HALT_COMPILER();
?>
--EXPECTF--
-internal corruption of phar "%swebphar_compilefail.php" (truncated manifest at manifest length)
+PharException: internal corruption of phar "%swebphar_compilefail.php" (truncated manifest at manifest length)
diff --git a/ext/phar/tests/zip/033.phpt b/ext/phar/tests/zip/033.phpt
index cf5ccd9a510..582ffbf8267 100644
--- a/ext/phar/tests/zip/033.phpt
+++ b/ext/phar/tests/zip/033.phpt
@@ -41,7 +41,7 @@
$phar['test']->chmod(0666);
var_dump($phar['test']->isReadable());
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
diff --git a/ext/phar/tests/zip/033a.phpt b/ext/phar/tests/zip/033a.phpt
index b11ea44ed32..33d9e17acb9 100644
--- a/ext/phar/tests/zip/033a.phpt
+++ b/ext/phar/tests/zip/033a.phpt
@@ -37,7 +37,7 @@
$phar['test']->chmod(0666);
var_dump($phar['test']->isExecutable());
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -46,4 +46,4 @@
?>
--EXPECTF--
bool(false)
-Cannot modify permissions for file "a.php" in phar "%sa.phar.zip", write operations are prohibited
+PharException: Cannot modify permissions for file "a.php" in phar "%sa.phar.zip", write operations are prohibited
diff --git a/ext/phar/tests/zip/alias_acrobatics.phpt b/ext/phar/tests/zip/alias_acrobatics.phpt
index 2ff5fd5dcc7..a8133ef32e0 100644
--- a/ext/phar/tests/zip/alias_acrobatics.phpt
+++ b/ext/phar/tests/zip/alias_acrobatics.phpt
@@ -17,19 +17,19 @@
try {
$a = new Phar($fname2, 0, 'foo');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
copy($fname, $fname2);
echo "2\n";
try {
$a = new Phar($fname2);
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$b = new Phar($fname, 0, 'another');
} catch (Exception $e) {
-echo $e->getMessage(),"\n";
+echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -38,7 +38,7 @@
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.zip');
?>
--EXPECTF--
-alias "foo" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.2.phar.zip"
+UnexpectedValueException: alias "foo" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.2.phar.zip"
2
-phar error: Unable to add zip-based phar "%salias_acrobatics.2.phar.zip" with implicit alias, alias is already in use
-alias "another" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.phar.zip"
+UnexpectedValueException: phar error: Unable to add zip-based phar "%salias_acrobatics.2.phar.zip" with implicit alias, alias is already in use
+UnexpectedValueException: alias "another" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.phar.zip"
diff --git a/ext/phar/tests/zip/badalias.phpt b/ext/phar/tests/zip/badalias.phpt
index 39a3261c088..7d31eaf9103 100644
--- a/ext/phar/tests/zip/badalias.phpt
+++ b/ext/phar/tests/zip/badalias.phpt
@@ -13,13 +13,13 @@
try {
new Phar($e . "badalias$i.phar.zip");
} catch (Exception $ee) {
-echo $ee->getMessage(), "\n";
+echo $ee::class, ': ', $ee->getMessage(), "\n";
}
}
?>
--EXPECTF--
-phar error: invalid alias "hi/there" in zip-based phar "%sbadalias1.phar.zip"
-phar error: invalid alias "hi\there" in zip-based phar "%sbadalias2.phar.zip"
-phar error: invalid alias "hi\there" in zip-based phar "%sbadalias3.phar.zip"
-phar error: invalid alias "hi;there" in zip-based phar "%sbadalias4.phar.zip"
-phar error: invalid alias "hi:there" in zip-based phar "%sbadalias5.phar.zip"
+UnexpectedValueException: phar error: invalid alias "hi/there" in zip-based phar "%sbadalias1.phar.zip"
+UnexpectedValueException: phar error: invalid alias "hi\there" in zip-based phar "%sbadalias2.phar.zip"
+UnexpectedValueException: phar error: invalid alias "hi\there" in zip-based phar "%sbadalias3.phar.zip"
+UnexpectedValueException: phar error: invalid alias "hi;there" in zip-based phar "%sbadalias4.phar.zip"
+UnexpectedValueException: phar error: invalid alias "hi:there" in zip-based phar "%sbadalias5.phar.zip"
diff --git a/ext/phar/tests/zip/bzip2.phpt b/ext/phar/tests/zip/bzip2.phpt
index 51535d981d9..9c1a3a76920 100644
--- a/ext/phar/tests/zip/bzip2.phpt
+++ b/ext/phar/tests/zip/bzip2.phpt
@@ -15,7 +15,7 @@
$a = new Phar(dirname(__FILE__) . '/files/bz2_alias.phar.zip');
var_dump($a->getAlias());
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/phar/tests/zip/corrupt_001.phpt b/ext/phar/tests/zip/corrupt_001.phpt
index 69edece7163..63da5e9be3a 100644
--- a/ext/phar/tests/zip/corrupt_001.phpt
+++ b/ext/phar/tests/zip/corrupt_001.phpt
@@ -7,14 +7,14 @@
try {
new PharData(__DIR__ . '/files/count1.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/count2.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount1.zip"
-phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount2.zip"
+UnexpectedValueException: phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount1.zip"
+UnexpectedValueException: phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount2.zip"
diff --git a/ext/phar/tests/zip/corrupt_002.phpt b/ext/phar/tests/zip/corrupt_002.phpt
index 6650196504d..8f9fd80a628 100644
--- a/ext/phar/tests/zip/corrupt_002.phpt
+++ b/ext/phar/tests/zip/corrupt_002.phpt
@@ -7,8 +7,8 @@
try {
new PharData(__DIR__ . '/files/nozipend.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: end of central directory not found in zip-based phar "%snozipend.zip"
+UnexpectedValueException: phar error: end of central directory not found in zip-based phar "%snozipend.zip"
diff --git a/ext/phar/tests/zip/corrupt_003.phpt b/ext/phar/tests/zip/corrupt_003.phpt
index 150289ca8a8..efb2c2e0344 100644
--- a/ext/phar/tests/zip/corrupt_003.phpt
+++ b/ext/phar/tests/zip/corrupt_003.phpt
@@ -7,8 +7,8 @@
try {
new PharData(__DIR__ . '/files/filecomment.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: end of central directory not found in zip-based phar "%sfilecomment.zip"
+UnexpectedValueException: phar error: end of central directory not found in zip-based phar "%sfilecomment.zip"
diff --git a/ext/phar/tests/zip/corrupt_004.phpt b/ext/phar/tests/zip/corrupt_004.phpt
index e005488e3a1..48eb75e4cc9 100644
--- a/ext/phar/tests/zip/corrupt_004.phpt
+++ b/ext/phar/tests/zip/corrupt_004.phpt
@@ -7,8 +7,8 @@
try {
new PharData(__DIR__ . '/files/cdir_offset.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: corrupted central directory entry, no magic signature in zip-based phar "%scdir_offset.zip"
+UnexpectedValueException: phar error: corrupted central directory entry, no magic signature in zip-based phar "%scdir_offset.zip"
diff --git a/ext/phar/tests/zip/corrupt_005.phpt b/ext/phar/tests/zip/corrupt_005.phpt
index 027d0f6e94d..2f4c1246fda 100644
--- a/ext/phar/tests/zip/corrupt_005.phpt
+++ b/ext/phar/tests/zip/corrupt_005.phpt
@@ -7,8 +7,8 @@
try {
new PharData(__DIR__ . '/files/encrypted.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: Cannot process encrypted zip files in zip-based phar "%sencrypted.zip"
+UnexpectedValueException: phar error: Cannot process encrypted zip files in zip-based phar "%sencrypted.zip"
diff --git a/ext/phar/tests/zip/corrupt_006.phpt b/ext/phar/tests/zip/corrupt_006.phpt
index 045bd77dcda..25fed4de259 100644
--- a/ext/phar/tests/zip/corrupt_006.phpt
+++ b/ext/phar/tests/zip/corrupt_006.phpt
@@ -7,8 +7,8 @@
try {
new PharData(__DIR__ . '/files/stdin.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: Cannot process zips created from stdin (zero-length filename) in zip-based phar "%sstdin.zip"
+UnexpectedValueException: phar error: Cannot process zips created from stdin (zero-length filename) in zip-based phar "%sstdin.zip"
diff --git a/ext/phar/tests/zip/corrupt_007.phpt b/ext/phar/tests/zip/corrupt_007.phpt
index 03bcae58ce6..5212ad83f86 100644
--- a/ext/phar/tests/zip/corrupt_007.phpt
+++ b/ext/phar/tests/zip/corrupt_007.phpt
@@ -7,8 +7,8 @@
try {
new PharData(__DIR__ . '/files/truncfilename.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: corrupted central directory entry, no magic signature in zip-based phar "%struncfilename.zip"
+UnexpectedValueException: phar error: corrupted central directory entry, no magic signature in zip-based phar "%struncfilename.zip"
diff --git a/ext/phar/tests/zip/corrupt_008.phpt b/ext/phar/tests/zip/corrupt_008.phpt
index db9f51d6ce0..50960a4f32c 100644
--- a/ext/phar/tests/zip/corrupt_008.phpt
+++ b/ext/phar/tests/zip/corrupt_008.phpt
@@ -7,92 +7,92 @@
try {
new PharData(__DIR__ . '/files/compress_unsup1.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup2.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup3.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup4.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup5.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup6.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup7.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup9.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup10.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup14.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup18.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup19.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup97.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsup98.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new PharData(__DIR__ . '/files/compress_unsupunknown.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: unsupported compression method (Shrunk) used in this zip in zip-based phar "%scompress_unsup1.zip"
-phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup2.zip"
-phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup3.zip"
-phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup4.zip"
-phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup5.zip"
-phar error: unsupported compression method (Implode) used in this zip in zip-based phar "%scompress_unsup6.zip"
-phar error: unsupported compression method (Tokenize) used in this zip in zip-based phar "%scompress_unsup7.zip"
-phar error: unsupported compression method (Deflate64) used in this zip in zip-based phar "%scompress_unsup9.zip"
-phar error: unsupported compression method (PKWare Implode/old IBM TERSE) used in this zip in zip-based phar "%scompress_unsup10.zip"
-phar error: unsupported compression method (LZMA) used in this zip in zip-based phar "%scompress_unsup14.zip"
-phar error: unsupported compression method (IBM TERSE) used in this zip in zip-based phar "%scompress_unsup18.zip"
-phar error: unsupported compression method (IBM LZ77) used in this zip in zip-based phar "%scompress_unsup19.zip"
-phar error: unsupported compression method (WavPack) used in this zip in zip-based phar "%scompress_unsup97.zip"
-phar error: unsupported compression method (PPMd) used in this zip in zip-based phar "%scompress_unsup98.zip"
-phar error: unsupported compression method (unknown) used in this zip in zip-based phar "%scompress_unsupunknown.zip"
+UnexpectedValueException: phar error: unsupported compression method (Shrunk) used in this zip in zip-based phar "%scompress_unsup1.zip"
+UnexpectedValueException: phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup2.zip"
+UnexpectedValueException: phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup3.zip"
+UnexpectedValueException: phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup4.zip"
+UnexpectedValueException: phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup5.zip"
+UnexpectedValueException: phar error: unsupported compression method (Implode) used in this zip in zip-based phar "%scompress_unsup6.zip"
+UnexpectedValueException: phar error: unsupported compression method (Tokenize) used in this zip in zip-based phar "%scompress_unsup7.zip"
+UnexpectedValueException: phar error: unsupported compression method (Deflate64) used in this zip in zip-based phar "%scompress_unsup9.zip"
+UnexpectedValueException: phar error: unsupported compression method (PKWare Implode/old IBM TERSE) used in this zip in zip-based phar "%scompress_unsup10.zip"
+UnexpectedValueException: phar error: unsupported compression method (LZMA) used in this zip in zip-based phar "%scompress_unsup14.zip"
+UnexpectedValueException: phar error: unsupported compression method (IBM TERSE) used in this zip in zip-based phar "%scompress_unsup18.zip"
+UnexpectedValueException: phar error: unsupported compression method (IBM LZ77) used in this zip in zip-based phar "%scompress_unsup19.zip"
+UnexpectedValueException: phar error: unsupported compression method (WavPack) used in this zip in zip-based phar "%scompress_unsup97.zip"
+UnexpectedValueException: phar error: unsupported compression method (PPMd) used in this zip in zip-based phar "%scompress_unsup98.zip"
+UnexpectedValueException: phar error: unsupported compression method (unknown) used in this zip in zip-based phar "%scompress_unsupunknown.zip"
diff --git a/ext/phar/tests/zip/corrupt_009.phpt b/ext/phar/tests/zip/corrupt_009.phpt
index 76059bb6012..fd812d57800 100644
--- a/ext/phar/tests/zip/corrupt_009.phpt
+++ b/ext/phar/tests/zip/corrupt_009.phpt
@@ -7,8 +7,8 @@
try {
new PharData(__DIR__ . '/files/extralen_toolong.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: Unable to process extra field header for file in central directory in zip-based phar "%sextralen_toolong.zip"
+UnexpectedValueException: phar error: Unable to process extra field header for file in central directory in zip-based phar "%sextralen_toolong.zip"
diff --git a/ext/phar/tests/zip/corrupt_010.phpt b/ext/phar/tests/zip/corrupt_010.phpt
index 549be171e3c..3a6d929327c 100644
--- a/ext/phar/tests/zip/corrupt_010.phpt
+++ b/ext/phar/tests/zip/corrupt_010.phpt
@@ -7,8 +7,8 @@
try {
new PharData(__DIR__ . '/files/disknumber.zip');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-phar error: split archives spanning multiple zips cannot be processed in zip-based phar "%sdisknumber.zip"
+UnexpectedValueException: phar error: split archives spanning multiple zips cannot be processed in zip-based phar "%sdisknumber.zip"
diff --git a/ext/phar/tests/zip/create_new_phar_b.phpt b/ext/phar/tests/zip/create_new_phar_b.phpt
index c976a3a2dde..7744656bb83 100644
--- a/ext/phar/tests/zip/create_new_phar_b.phpt
+++ b/ext/phar/tests/zip/create_new_phar_b.phpt
@@ -18,4 +18,3 @@
Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d
Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.zip/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d
-
diff --git a/ext/phar/tests/zip/delete_in_phar.phpt b/ext/phar/tests/zip/delete_in_phar.phpt
index 8ebdd95cd2d..1aaf2ab9641 100644
--- a/ext/phar/tests/zip/delete_in_phar.phpt
+++ b/ext/phar/tests/zip/delete_in_phar.phpt
@@ -44,4 +44,3 @@
Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.zip" in %sdelete_in_phar.php on line %d
Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.zip/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d
-
diff --git a/ext/phar/tests/zip/delete_in_phar_b.phpt b/ext/phar/tests/zip/delete_in_phar_b.phpt
index c9a1c25fe27..338b09ebe1d 100644
--- a/ext/phar/tests/zip/delete_in_phar_b.phpt
+++ b/ext/phar/tests/zip/delete_in_phar_b.phpt
@@ -43,4 +43,3 @@
This is a
This is b
This is b/c
-
diff --git a/ext/phar/tests/zip/delete_in_phar_confirm.phpt b/ext/phar/tests/zip/delete_in_phar_confirm.phpt
index 14a2a78b62e..0fcff2da43f 100644
--- a/ext/phar/tests/zip/delete_in_phar_confirm.phpt
+++ b/ext/phar/tests/zip/delete_in_phar_confirm.phpt
@@ -49,4 +49,3 @@
Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.zip" in %sdelete_in_phar_confirm.php on line %d
Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.zip/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d
-
diff --git a/ext/phar/tests/zip/exists_as_phar.phpt b/ext/phar/tests/zip/exists_as_phar.phpt
index 1dbab22a3d8..31ec74b1691 100644
--- a/ext/phar/tests/zip/exists_as_phar.phpt
+++ b/ext/phar/tests/zip/exists_as_phar.phpt
@@ -23,7 +23,7 @@
try {
$p = new Phar($tname);
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -33,4 +33,4 @@
unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar');
?>
--EXPECTF--
-phar zip error: phar "%sexists_as_phar.phar.zip" already exists as a regular phar and must be deleted from disk prior to creating as a zip-based phar
+UnexpectedValueException: phar zip error: phar "%sexists_as_phar.phar.zip" already exists as a regular phar and must be deleted from disk prior to creating as a zip-based phar
diff --git a/ext/phar/tests/zip/getalias.phpt b/ext/phar/tests/zip/getalias.phpt
index 8f3edd6ee32..e462d0c6d8a 100644
--- a/ext/phar/tests/zip/getalias.phpt
+++ b/ext/phar/tests/zip/getalias.phpt
@@ -34,7 +34,7 @@
try {
$phar['.phar/alias.txt'] = 'pinocchio';
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getAlias());
@@ -53,6 +53,6 @@
string(%d) "%sgetalias.phar.zip"
string(13) "jiminycricket"
string(13) "jiminycricket"
-Cannot set alias ".phar/alias.txt" directly in phar "%sgetalias.phar.zip", use setAlias
+BadMethodCallException: Cannot set alias ".phar/alias.txt" directly in phar "%sgetalias.phar.zip", use setAlias
string(13) "jiminycricket"
string(9) "pinocchio"
diff --git a/ext/phar/tests/zip/odt.phpt b/ext/phar/tests/zip/odt.phpt
index 53683c4ae11..483dd706a8e 100644
--- a/ext/phar/tests/zip/odt.phpt
+++ b/ext/phar/tests/zip/odt.phpt
@@ -17,7 +17,7 @@
try {
$b = new Phar(__DIR__ . '/files/odt.odt');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -29,4 +29,4 @@
phar://%sodt.odt%cmimetype
phar://%sodt.odt%csettings.xml
phar://%sodt.odt%cstyles.xml
-Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist
+UnexpectedValueException: Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist
diff --git a/ext/phar/tests/zip/open_for_write_newfile_b.phpt b/ext/phar/tests/zip/open_for_write_newfile_b.phpt
index 4ca15e58c29..f80b2f7e4c1 100644
--- a/ext/phar/tests/zip/open_for_write_newfile_b.phpt
+++ b/ext/phar/tests/zip/open_for_write_newfile_b.phpt
@@ -43,4 +43,3 @@
Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.zip" in %sopen_for_write_newfile_b.php on line %d
Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.zip/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d
-
diff --git a/ext/phar/tests/zip/open_for_write_newfile_c.phpt b/ext/phar/tests/zip/open_for_write_newfile_c.phpt
index 89a380d345a..a6ad9b697d3 100644
--- a/ext/phar/tests/zip/open_for_write_newfile_c.phpt
+++ b/ext/phar/tests/zip/open_for_write_newfile_c.phpt
@@ -43,4 +43,3 @@
Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.zip" in %sopen_for_write_newfile_c.php on line %d
Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.zip/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d
-
diff --git a/ext/phar/tests/zip/phar_buildfromiterator5.phpt b/ext/phar/tests/zip/phar_buildfromiterator5.phpt
index 3c587dfc9c8..4a3797ed46f 100644
--- a/ext/phar/tests/zip/phar_buildfromiterator5.phpt
+++ b/ext/phar/tests/zip/phar_buildfromiterator5.phpt
@@ -40,13 +40,11 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator.phar.zip');
var_dump($phar->buildFromIterator(new myIterator(array('a' => new stdClass))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
rewind
valid
current
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)
+UnexpectedValueException: Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object)
diff --git a/ext/phar/tests/zip/phar_buildfromiterator6.phpt b/ext/phar/tests/zip/phar_buildfromiterator6.phpt
index 9d9140bc343..99387bf7dc7 100644
--- a/ext/phar/tests/zip/phar_buildfromiterator6.phpt
+++ b/ext/phar/tests/zip/phar_buildfromiterator6.phpt
@@ -40,8 +40,7 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator.phar.zip');
var_dump($phar->buildFromIterator(new myIterator(array(basename(__FILE__, 'php') . 'phpt'))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -49,5 +48,4 @@ function rewind(): void {
valid
current
key
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned an invalid key (must return a string)
+UnexpectedValueException: Iterator myIterator returned an invalid key (must return a string)
diff --git a/ext/phar/tests/zip/phar_buildfromiterator7.phpt b/ext/phar/tests/zip/phar_buildfromiterator7.phpt
index f62be404a1e..59ee896b003 100644
--- a/ext/phar/tests/zip/phar_buildfromiterator7.phpt
+++ b/ext/phar/tests/zip/phar_buildfromiterator7.phpt
@@ -40,8 +40,7 @@ function rewind(): void {
$phar = new Phar(__DIR__ . '/buildfromiterator.phar.zip');
var_dump($phar->buildFromIterator(new myIterator(array('a' => basename(__FILE__, 'php') . '/oopsie/there.phpt'))));
} catch (Exception $e) {
- var_dump(get_class($e));
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -49,5 +48,4 @@ function rewind(): void {
valid
current
key
-%s(24) "UnexpectedValueException"
-Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
+UnexpectedValueException: Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt"
diff --git a/ext/phar/tests/zip/phar_copy.phpt b/ext/phar/tests/zip/phar_copy.phpt
index de9b1c9dd76..344640d27ff 100644
--- a/ext/phar/tests/zip/phar_copy.phpt
+++ b/ext/phar/tests/zip/phar_copy.phpt
@@ -32,7 +32,7 @@
}
catch(Exception $e)
{
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.readonly',1);
$p2 = new Phar($fname2);
@@ -48,7 +48,7 @@
<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '2.phar.php'); ?>
--EXPECTF--
hihibool(true)
-file "/error/.." contains invalid characters upper directory reference, cannot be copied from "a" in phar %s
+UnexpectedValueException: file "/error/.." contains invalid characters upper directory reference, cannot be copied from "a" in phar %s
bool(true)
a: hib: hic: hi===DONE===
diff --git a/ext/phar/tests/zip/phar_setalias2.phpt b/ext/phar/tests/zip/phar_setalias2.phpt
index 2d113fbf2c5..d5bdc37fc88 100644
--- a/ext/phar/tests/zip/phar_setalias2.phpt
+++ b/ext/phar/tests/zip/phar_setalias2.phpt
@@ -33,7 +33,7 @@
try {
$phar->setAlias('test');
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -44,4 +44,4 @@
--EXPECTF--
hio
test
-alias "test" is already used for archive "%sphar_setalias2.phar.zip" and cannot be used for other archives
+PharException: alias "test" is already used for archive "%sphar_setalias2.phar.zip" and cannot be used for other archives
diff --git a/ext/phar/tests/zip/phar_setdefaultstub.phpt b/ext/phar/tests/zip/phar_setdefaultstub.phpt
index e979b59b1a4..6d1cd0b42bb 100644
--- a/ext/phar/tests/zip/phar_setdefaultstub.phpt
+++ b/ext/phar/tests/zip/phar_setdefaultstub.phpt
@@ -23,7 +23,7 @@
$phar->setDefaultStub();
$phar->stopBuffering();
} catch(Exception $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
@@ -34,13 +34,13 @@
try {
$phar->setDefaultStub('my/custom/thingy.php');
} catch(Error $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->stopBuffering();
} catch(Exception $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
@@ -51,13 +51,13 @@
try {
$phar->setDefaultStub('my/custom/thingy.php', 'the/web.php');
} catch(ValueError $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$phar->stopBuffering();
} catch(Exception $e) {
- echo $e->getMessage(). "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
@@ -76,11 +76,11 @@
__HALT_COMPILER();"
============================================================================
============================================================================
-Phar::setDefaultStub(): Argument #1 ($index) must be null for a tar- or zip-based phar stub, string given
+ValueError: Phar::setDefaultStub(): Argument #1 ($index) must be null for a tar- or zip-based phar stub, string given
string(60) "<?php // zip-based phar archive stub file
__HALT_COMPILER();"
============================================================================
============================================================================
-Phar::setDefaultStub(): Argument #1 ($index) must be null for a tar- or zip-based phar stub, string given
+ValueError: Phar::setDefaultStub(): Argument #1 ($index) must be null for a tar- or zip-based phar stub, string given
string(60) "<?php // zip-based phar archive stub file
__HALT_COMPILER();"
diff --git a/ext/phar/tests/zip/phar_stub_error.phpt b/ext/phar/tests/zip/phar_stub_error.phpt
index 74319c90607..c95a999ffd3 100644
--- a/ext/phar/tests/zip/phar_stub_error.phpt
+++ b/ext/phar/tests/zip/phar_stub_error.phpt
@@ -26,7 +26,7 @@
}
catch(exception $e)
{
- echo 'Exception: ' . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($phar->getStub());
var_dump($phar->getStub() == $stub);
@@ -44,7 +44,7 @@
string(50) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>
"
bool(true)
-Exception: illegal stub for zip-based phar "%sphar_stub_error.phar.zip"
+PharException: illegal stub for zip-based phar "%sphar_stub_error.phar.zip"
string(50) "<?php echo "first stub\n"; __HALT_COMPILER(); ?>
"
bool(true)
diff --git a/ext/phar/tests/zip/require_hash.phpt b/ext/phar/tests/zip/require_hash.phpt
index 0d94083683c..c688de5a9c7 100644
--- a/ext/phar/tests/zip/require_hash.phpt
+++ b/ext/phar/tests/zip/require_hash.phpt
@@ -25,7 +25,7 @@
$phar = new Phar($fname);
var_dump($phar->getStub());
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
ini_set('phar.require_hash', 0);
try {
@@ -35,7 +35,7 @@
$phar->setSignatureAlgorithm(Phar::MD5);
var_dump($phar->getSignature());
} catch (Exception $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -46,12 +46,12 @@
@unlink(__DIR__ . '/require_hash.zip');
?>
--EXPECTF--
-phar error: signature is missing in zip-based phar "%srequire_hash.phar.zip"
-bool(false)
-array(2) {
- ["hash"]=>
- string(32) "%s"
- ["hash_type"]=>
- string(3) "MD5"
-}
+UnexpectedValueException: phar error: signature is missing in zip-based phar "%srequire_hash.phar.zip"
+bool(false)
+array(2) {
+ ["hash"]=>
+ string(32) "%s"
+ ["hash_type"]=>
+ string(3) "MD5"
+}
===DONE===
diff --git a/ext/phar/tests/zip/zip_extra_underflow.phpt b/ext/phar/tests/zip/zip_extra_underflow.phpt
index e37a3493b66..77595dc9b2f 100644
--- a/ext/phar/tests/zip/zip_extra_underflow.phpt
+++ b/ext/phar/tests/zip/zip_extra_underflow.phpt
@@ -80,7 +80,7 @@ function uint32($value) {
echo "Loaded corrupt ZIP\n";
echo $phar[$entry]->getMTime(), "\n";
} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--CLEAN--
@@ -88,4 +88,4 @@ function uint32($value) {
@unlink(__DIR__ . '/zip_extra_underflow.zip');
?>
--EXPECTF--
-phar error: Unable to process extra field header for file in central directory in zip-based phar "%szip_extra_underflow.zip"
+UnexpectedValueException: phar error: Unable to process extra field header for file in central directory in zip-based phar "%szip_extra_underflow.zip"
diff --git a/ext/phar/tests/zip/zlib.phpt b/ext/phar/tests/zip/zlib.phpt
index 4f33761b092..9f444904a3a 100644
--- a/ext/phar/tests/zip/zlib.phpt
+++ b/ext/phar/tests/zip/zlib.phpt
@@ -11,7 +11,7 @@
$a = new Phar(__DIR__ . '/files/zlib_alias.phar.zip');
var_dump($a->getAlias());
} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--