From 46405c43e67d50b863cf0c49959d559dc919d41f Mon Sep 17 00:00:00 2001 From: Marco van 't Wout Date: Tue, 4 Jun 2024 15:02:40 +0200 Subject: [PATCH] Attempt to fix failing unit tests that use runInSeparateProcess --- composer.json | 3 ++- tests/phpunit_php83.patch | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/phpunit_php83.patch diff --git a/composer.json b/composer.json index 932558e60a..fb980afddc 100644 --- a/composer.json +++ b/composer.json @@ -108,7 +108,8 @@ "phpunit/phpunit": { "Fix PHP 7 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php7.patch", "Fix PHP 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php8.patch", - "Fix PHP 8.1 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php81.patch" + "Fix PHP 8.1 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php81.patch", + "Fix PHP 8.3 compatibility": "tests/phpunit_php83.patch" } } }, diff --git a/tests/phpunit_php83.patch b/tests/phpunit_php83.patch new file mode 100644 index 0000000000..cdcafe842f --- /dev/null +++ b/tests/phpunit_php83.patch @@ -0,0 +1,11 @@ +--- a/src/Util/PHP/Template/TestCaseMethod.tpl.dist ++++ b/src/Util/PHP/Template/TestCaseMethod.tpl.dist +@@ -56,7 +56,7 @@ + } + + @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ +- if ($stdout = stream_get_contents(STDOUT)) { ++ if ($stdout = @stream_get_contents(STDOUT)) { + $output = $stdout . $output; + } +