ReflectionType::__toString() is deprecated in PHP 7.4
| Q | A |
|---|---|
| PHPUnit version | 8.1.3 |
| PHP version | 7.4snapshot |
| Installation Method | Composer |
Hello,
I have an issue on Travis CI using PHPUnit with convertWarningsToExceptions.
Function ReflectionType::__toString() is deprecated
It only happens in tests using getMockBuilder so this must be related to that the deprecation (since PHP 5.5.0) that now is throwing an warning: https://php.net/manual/de/reflectiontype.tostring.php
PHPUnit 8.1.3 is no longer supported. Please try with PHPUnit 8.2.3, thanks.
Awesome, I got it back working using the latest version. Thank you Sebastian...
We have the same issue on PHPUnit 6.5, and the framework does not support > 6 here. Is there a way to patch out the PHPUnit 6 series to be PHP7.4 compatible?
EDIT To be precise: Part of the test harness is about PHP5.6 testing, as such the PHPUnit 6 series is needed here still.
@dereuromark i have similar issue in Crunz, here is how i solved it: create patched class (PHPUnit_Framework_MockObject_Generator), then use PHPUnit's bootstrap file to replace original class with patched one when PHP version is same or newer than 7.1. Whole PR for reference: https://github.com/lavary/crunz/commit/8ef1370aa47009fd1945fb73f0414bd88634ada2
Quite annoying to have to do that on like 30 repos etc though :/
I am sure that Sebastian does not give support for PHPUnit 6 to get PHP 7.4 running as he is very strict when it comes to end of life. 😆
Not a good idea to comment a closed issue aswell, open a fresh one with your description.
I am sure that Sebastian does not give support for PHPUnit 6
Actually I'm using PHPUnit 5.7, because I need PHP 5.6 support :)
You cannot support both as new PHPUnit versions enforce return types for setup() and tearDown() ... so even with fancy CI that installes PHPUnit according to PHP version: this is a dead end!
- You can have 2 testing suites
- Rewrite testing suite files to PHP5 on the fly
- Finally, drop that old shit
PHPUnit 8.1.3 is no longer supported. Please try with PHPUnit 8.2.3, thanks.
@sebastianbergmann Could you please let me know what should be the compatible version of allure-framework/allure-phpunit when we upgrade to PHPUnit 8.2.3?
I am getting this error - https://github.com/allure-framework/allure-phpunit/issues/40
Thanks