-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Refactor tests to use willReturnCallback with invocation matcher for withConsecutive deprecated method.
#20646
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 refactors PHPUnit test files to replace the deprecated withConsecutive method with a willReturnCallback approach using invocation matchers, addressing PHPUnit's deprecation notice (issue #5063).
Key Changes:
- Replaced
withConsecutive()withwillReturnCallback()and manual invocation count checking - Added invocation count matchers (
$this->exactly(n)) to track method call sequences - Updated class references to use
::classsyntax instead of string literals
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/framework/log/TargetTest.php | Refactored two test methods to use callback-based assertion pattern instead of withConsecutive |
| tests/framework/log/SyslogTargetTest.php | Converted 7 consecutive syslog method expectations to callback-based validation |
| tests/framework/log/DispatcherTest.php | Updated dispatcher test to use callback pattern with improved string comparison (str_starts_with) |
| tests/framework/BaseYiiTest.php | Migrated 6 consecutive logger method expectations to use invocation matcher callbacks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…r `withConsecutive` deprecated method.
…` in `DispatcherTest` class.
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 13 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… compatibility Copilot review.
sebastianbergmann/phpunit#5063