From f369064c7ddb8fce6206d84724b932971ce46141 Mon Sep 17 00:00:00 2001 From: Koji Tanaka Date: Sat, 7 Jan 2023 19:42:13 +0900 Subject: [PATCH] test: In PHP 8.0+ DebuggerTest::testOutput() marked as incomplete. --- lib/Cake/Test/Case/Utility/DebuggerTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 4e6eba8eb..6e700e157 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -105,6 +105,16 @@ class DebuggerTest extends CakeTestCase { * @return void */ public function testOutput() { + // In PHP8.0+, + // the errcontext argument will no longer be passed to custom error handlers set with set_error_handler(). + // see: https://www.php.net/manual/en/migration80.incompatible.php + // Therefore, the contents of the Context (variables that existed in the scope the error was triggered in) + // are not output when a PHP error occurs. + // Except for the above, Debugger::output() works. + // However, it is incomplete, so marked. + if (PHP_MAJOR_VERSION >= 8) { + $this->markTestIncomplete('Context output no longer works in PHP 8.0+.'); + } set_error_handler('Debugger::showError'); $this->_restoreError = true;