test: expose upstream codeception sprintf bug#4
Conversation
6a0faa9 to
91e7776
Compare
📝 WalkthroughWalkthroughA new unit test file is added to expose a known upstream Codeception 5 bug in ReportPrinter that occurs when test names contain percent signs with the --report flag. The test uses a data-driven approach with a single test case labeled "100% coverage". Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip CodeRabbit can use your project's `phpmd` ruleset to improve the quality of PHP code reviews.You can customize the |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/Unit/ReportPrinterSprintfBugTest.php (1)
25-34: Consider aligning return type with PHPDoc for precision.The PHPDoc documents
@return array<string, array<int>>but the method signature usesiterable. While compatible, usingarrayas the return type would be more precise and consistent with the documentation.♻️ Optional: Use more specific return type
/** * `@return` array<string, array<int>> */ - public static function provideEscapedPercentInNameCases(): iterable + public static function provideEscapedPercentInNameCases(): array { return [ // This test is expected to fail with `ArgumentCountError` due to a bug in Codeception ReportPrinter '100% coverage' => [1], ]; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/Unit/ReportPrinterSprintfBugTest.php` around lines 25 - 34, The method provideEscapedPercentInNameCases currently declares an iterable return type but the PHPDoc and actual returned value are an array; update the signature of provideEscapedPercentInNameCases to return array to match the `@return` array<string, array<int>> PHPDoc and the returned literal, ensuring the method name provideEscapedPercentInNameCases and its return value stay unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/Unit/ReportPrinterSprintfBugTest.php`:
- Around line 25-34: The method provideEscapedPercentInNameCases currently
declares an iterable return type but the PHPDoc and actual returned value are an
array; update the signature of provideEscapedPercentInNameCases to return array
to match the `@return` array<string, array<int>> PHPDoc and the returned literal,
ensuring the method name provideEscapedPercentInNameCases and its return value
stay unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f3d7d7d1-f1b0-4d70-a5dd-3d505e22d2d1
📒 Files selected for processing (1)
tests/Unit/ReportPrinterSprintfBugTest.php
This adds a unit test demonstrating the ArgumentCountError bug in Codeception ReportPrinter when formatting output with a % symbol. The test is currently intentionally failing and references Codeception/Codeception#6927 until the bug is resolved.
Summary by CodeRabbit