-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Deprecate MockBuilder::setMethods() #3770
Labels
type/backward-compatibility
Something will be/is intentionally broken
Milestone
Comments
sebastianbergmann
added
feature-removal
type/backward-compatibility
Something will be/is intentionally broken
labels
Jul 31, 2019
stronk7
added a commit
to stronk7/moodle
that referenced
this issue
Mar 11, 2021
The current ->setMethods() has been silently (won't emit any warning) in PHPUnit 9. And will stop working (current plans) in PHPUnit 10. Basically the now deprecated method has been split into: - onlyMethods(): To point to existing methods in the mocked artifact. - addMethods(): To point to non existing (yet) methods in the mocked artifact. In practice that means that all our current setMethods() calls can be converted to onlyMethods() (existing) and done. The addMethods() is mostly useful on development phases, not final testing. Finally note that <null> isn't accepted anymore as parameter to double all the methods. Instead empty array [] must be used. Link: sebastianbergmann/phpunit#3770
stronk7
added a commit
to stronk7/moodle
that referenced
this issue
Mar 11, 2021
The current ->setMethods() has been silently (won't emit any warning) in PHPUnit 9. And will stop working (current plans) in PHPUnit 10. Basically the now deprecated method has been split into: - onlyMethods(): To point to existing methods in the mocked artifact. - addMethods(): To point to non existing (yet) methods in the mocked artifact. In practice that means that all our current setMethods() calls can be converted to onlyMethods() (existing) and done. The addMethods() is mostly useful on development phases, not final testing. Finally note that <null> isn't accepted anymore as parameter to double all the methods. Instead empty array [] must be used. Link: sebastianbergmann/phpunit#3770
stronk7
added a commit
to moodlehq/moodle-webservice_xmlrpc
that referenced
this issue
Oct 22, 2022
The current ->setMethods() has been silently (won't emit any warning) in PHPUnit 9. And will stop working (current plans) in PHPUnit 10. Basically the now deprecated method has been split into: - onlyMethods(): To point to existing methods in the mocked artifact. - addMethods(): To point to non existing (yet) methods in the mocked artifact. In practice that means that all our current setMethods() calls can be converted to onlyMethods() (existing) and done. The addMethods() is mostly useful on development phases, not final testing. Finally note that <null> isn't accepted anymore as parameter to double all the methods. Instead empty array [] must be used. Link: sebastianbergmann/phpunit#3770
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See #3687 (comment) for details.
The text was updated successfully, but these errors were encountered: