Skip to content

Commit

Permalink
Attempt to fix failing unit tests that use runInSeparateProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovtwout committed Jun 4, 2024
1 parent baf5165 commit 46405c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down
11 changes: 11 additions & 0 deletions tests/phpunit_php83.patch
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 46405c4

Please sign in to comment.