-
Notifications
You must be signed in to change notification settings - Fork 15
ReflectionType::__toString() is deprecated #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For more context, here is the PR where I found the issue GoogleForCreators/web-stories-wp#8264 It seems to be an issue, with methods having return type hints + reflection. |
@spacedmonkey This is not an issue which this library will or should fix, as it is an issue caused by a wrong test setup configuration. The whole point of the polyfills is that you can use the modern, PHPUnit 9.x assertions and expectations (and fix the In short: you should not be running PHPUnit 6.x on PHP 7.4. You should be using PHPUnit 8.x or 9.x, which are both supported for PHP 7.4. You could even use PHPUnit 7.x, which will (hopefully) also fix this, even though not officially supported on PHP 7.4.
Looking at the repo you linked to, there are two things I can see:
To fix this with that context in mind:
To limit the update to just PHPUnit (and its dependencies), you can use a pattern like so (for the second option listed above): composer require --dev phpunit/phpunit:"^7.5" --update-with-dependencies --ignore-platform-reqs You're basically now trying to fit a square block into a round hole. |
@spacedmonkey Just checking: did my answer clarify things enough for you ? Can this issue be closed ? |
Closing for lack of reply. |
We worked around this issues, but patching PHPUnit 6.x to run in PHP 7.4. It makes everything a lot simpler, as means we can run PHP 6.x everywhere and it just works. |
I presume you mean PHPUnit 6.x ? PHP 6.x was never released. Either way, glad you got it working, but I still think you are trying to fit a square block into a round hole and that's not what this package will help you do. |
Running PHPUnit 6.5.14 in PHP 7.4, generate the following error when using
createMock
I wonder if this library could patch this issue.
PHPUnit issue sebastianbergmann/phpunit#3728
The text was updated successfully, but these errors were encountered: