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
Fix generating signatures with nullable unions #4451
Conversation
Codecov Report
@@ Coverage Diff @@
## 9.3 #4451 +/- ##
=========================================
Coverage 85.16% 85.16%
- Complexity 4511 4512 +1
=========================================
Files 243 243
Lines 12363 12363
=========================================
Hits 10529 10529
Misses 1834 1834
Continue to review full report at Codecov.
|
Can you provide a minimal, self-contained, reproducing example that shows the problem you want to solve? Thanks! I will then use your example to create a test case for PHPUnit's test double code generator. |
Essentially I think what triggers it, is mocking the ZipArchive class, namely the extractTo method. I believe this is the code triggering the issue in our test suite (probably the second expects is enough..): $zipArchive = $this->getMockBuilder('ZipArchive')->getMock();
$zipArchive->expects($this->any())
->method('open')
->will($this->returnValue(true));
$zipArchive->expects($this->any())
->method('extractTo')
->will($this->returnValue(false)); @nicolas-grekas said it was generating a mock with signature |
Thanks, @Seldaek. |
Merged manually, thanks. |
Thanks for the quick merge & release. I can confirm it's working well now. Down to 1 actual failure and then we're green on php 8 :) |
Glad I could help. |
@sebastianbergmann would you be favourable to release this fix for version |
PHPUnit 8.5 must work for PHP code compatible with PHP 7.2 on PHP 8. Are you saying that this is not the case? I do have to say, though, that I am confused why "installing it alongside with Symfony" should have an effect on how PHPUnit behaves. PHPUnit does not depend on any Symfony component. Or is Symfony's PHPUnit bridge causing your problem? |
When running "old" code base (like phpunit 8.5 in this case), one should expect that some deprecations are triggered. Either by the bridge, or the latest php, etc |
( if that is related to the bridge because I also don't get the link with Symfony yet ) |
I did experience the same issue (I think) trying to make Composer tests pass with PHPUnit 8.5 on PHP 7.2 to 8.1 in composer/composer#10343 The problem I saw was that some Symfony 6 code broke PHPUnit MockObject when running the PHP 8.x build (with PHPUnit 8.5). I did see a backport PR which was closed by @sebastianbergmann so I gave up on that project and went back to using symfony/phpunit-bridge to run multiple PHPUnit versions based on PHP version, which is working well now. |
Sorry, I think that my message has been misinterpreted. Sentry needs to support PHP |
Found while debugging the failure on https://github.com/composer/composer/runs/1101133265
I'd happily accept help to finish the PR (add tests especially).