-
-
Notifications
You must be signed in to change notification settings - Fork 512
Upgrade to PHPUnit 11 for PHP >= 8.2 and check deprecation messages #2902
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the test suite to use PHPUnit 11 for PHP 8.2+ while maintaining PHPUnit 10 for PHP 8.1, enabling better deprecation message testing support.
Key changes:
- PHPUnit version constraint updated to allow both 10.x and 11.x
- Migration from deprecated PHPUnit methods and annotations to modern attributes
- Addition of deprecation handling for Symfony lazy ghost objects
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| composer.json | Updates PHPUnit dependency constraint to support both version 10.5.58+ and 11.5.43+ |
| phpunit.xml.dist | Updates schema reference from PHPUnit 10.5 to 11.5 |
| tests/Tests/QueryTest.php | Replaces deprecated will($this->returnValue()) with willReturn() |
| tests/Tests/Functional/TargetDocumentTest.php | Migrates from docblock @doesNotPerformAssertions to attribute syntax |
| tests/Tests/Functional/ShardKeyTest.php | Adds guard to prevent accessing uninitialized logger in tearDown |
| tests/Tests/ConfigurationTest.php | Adds IgnoreDeprecations attribute to tests involving deprecated lazy ghost objects |
| tests/Tests/BaseTestCase.php | Reorders configuration logic to check native lazy object first before lazy ghost |
| .github/workflows/continuous-integration.yml | Adds conditional deprecation suppression for native proxy mode |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alcaeus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion to avoid a conditional, but LGTM otherwise.
b26c6b8 to
4d5d0a9
Compare
Summary
In order to test deprecation messages, we must use PHPUnit 9 with Symfony bridge or PHPUnit 11+.
This PR enable PHPUnit 11 with PHP 8.2+ (and keep 10 for PHP 8.1).
We have to ignore deprecation when Symfony lazy ghost are enabled, because the trait is deprecated.