From 0f5b0d42468e3df8b5d8ff59b51863efbceb51b1 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Tue, 13 Aug 2024 10:06:43 -0400 Subject: [PATCH] Skip deprecated E_USER_ERROR trigger on PHP 8.4+ --- test/Exception/ErrorExceptionTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Exception/ErrorExceptionTest.php b/test/Exception/ErrorExceptionTest.php index 2e675f3a..9f9f4640 100644 --- a/test/Exception/ErrorExceptionTest.php +++ b/test/Exception/ErrorExceptionTest.php @@ -68,7 +68,7 @@ public function getLevels() [\E_DEPRECATED, 'Deprecated'], [\E_USER_DEPRECATED, 'Deprecated'], [\E_RECOVERABLE_ERROR, 'Recoverable fatal error'], - [0, 'Error'], + [0, 'Error'], ]; } @@ -77,6 +77,10 @@ public function getLevels() */ public function testThrowExceptionAsErrorHandler($level, $type) { + // if (\version_compare(\PHP_VERSION, '8.4', '>=') && $level === \E_USER_ERROR) { + // $this->markTestSkipped('Passing E_USER_ERROR to trigger_error() is deprecated since 8.4'); + // } + \set_error_handler([ErrorException::class, 'throwException']); try { \trigger_error('{whot}', $level);