-
Notifications
You must be signed in to change notification settings - Fork 3
Upgrade to PHPUnit 11 #31
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
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpgrade PHPUnit to ^11.5, introduce Rector for automated code improvements, and modernize phpunit.xml.dist for PHPUnit 10+ compatibility to resolve CI failures with PHP 8.2’s readonly class syntax. Entity relationship diagram for updated phpunit.xml.dist configurationerDiagram
PHPUNIT {
string cacheDirectory
}
SOURCE {
string include
string exclude
}
PHPUNIT ||--|| SOURCE : contains
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
WalkthroughUpgrades PHPUnit from ^9.5.28 to ^11.5.43 and adds rector/rector ^2.2 as a dev dependency. Revises phpunit.xml.dist to separate source inclusion and coverage scope, introduces a top-level cacheDirectory, adds a Changes
Sequence Diagram(s)(omitted — configuration changes, no runtime control-flow to diagram) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #31 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 38 38
===========================================
Files 24 24
Lines 90 90
===========================================
Hits 90 90 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
phpunit.xml.dist (1)
19-20: Consider removing outdated phpVersion constraints.The
phpVersion="7.4"andphpVersion="8.0.0"constraints are legacy from when this project supported older PHP versions. Since composer.json now requires"php": "^8.2", these constraints are always satisfied and add no value. Consider removing them for clarity.Apply this diff to simplify:
- <directory phpVersion="7.4" phpVersionOperator=">=">tests-pecl-ext</directory> - <directory phpVersion="8.0.0" phpVersionOperator=">=">tests-php8</directory> + <directory>tests-pecl-ext</directory> + <directory>tests-php8</directory>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
composer.json(1 hunks)phpunit.xml.dist(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Sourcery review
🔇 Additional comments (4)
phpunit.xml.dist (3)
4-5: LGTM! Correct PHPUnit 11 configuration.The
cacheDirectoryattribute is correctly placed at the root<phpunit>element level, which is the required format for PHPUnit 10+.
6-13: LGTM! Proper modernization for PHPUnit 10+.The
<source>element with nested<include>and<exclude>blocks is the correct structure for PHPUnit 10+. Includingsrcand excludingsrc-deprecatedaligns with the autoload configuration in composer.json.
14-15: LGTM! Valid empty coverage element.An empty
<coverage>element is valid in PHPUnit 11. Coverage options are typically specified via CLI arguments (as seen in the composer scripts).composer.json (1)
23-24: No issues found. PHPUnit 11.5.43 is the current latest version with no active security advisories.Verification confirms that 11.5.43 is indeed the current latest release in the 11.x series. The security advisories returned are only for older versions (4.x and 5.x series). The version constraint
^11.5.43is appropriate and will receive future patch updates within the 11.x line.
Changes: - Upgrade PHPUnit from ^9.5 to ^11.5 - Add rector/rector ^2.2 for code quality - Update phpunit.xml.dist for PHPUnit 10+ compatibility: - Move include/exclude to <source> element - Move cacheDirectory to <phpunit> root element - Remove deprecated processUncoveredFiles attribute PHPUnit 11 requires PHP 8.2+ which matches project requirements. This also fixes php-parser compatibility with readonly class syntax in --prefer-lowest CI runs.
607fa37 to
4cfc8d2
Compare
Summary
Changes
Dependencies
^9.5.28→^11.5.43(requires PHP 8.2+, matches project requirements)^2.2for automated code quality improvementsConfiguration
Updated
phpunit.xml.distfor PHPUnit 10+ compatibility:<include>and<exclude>to<source>elementcacheDirectoryto<phpunit>root elementprocessUncoveredFilesattributeWhy This Change?
This fixes the CI failure with
readonly classsyntax in--prefer-lowestruns. The old PHPUnit 9 pulled in older versions ofnikic/php-parserthat couldn't parse PHP 8.2'sreadonly classsyntax, causing coverage analysis to fail.Test Plan
Related
Resolves the issue discovered in #30 where CI failed after merging due to php-parser version compatibility with readonly class syntax.
Summary by Sourcery
Upgrade PHPUnit to v11.5, update test configuration, and add Rector to improve code quality and resolve CI failures with PHP 8.2 readonly syntax
New Features:
Bug Fixes:
Enhancements:
Summary by CodeRabbit