Skip to content
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

Closed
sebastianbergmann opened this issue Jul 31, 2019 · 0 comments
Closed

Deprecate MockBuilder::setMethods() #3770

sebastianbergmann opened this issue Jul 31, 2019 · 0 comments
Assignees
Labels
type/backward-compatibility Something will be/is intentionally broken
Milestone

Comments

@sebastianbergmann
Copy link
Owner

See #3687 (comment) for details.

@sebastianbergmann sebastianbergmann added feature-removal type/backward-compatibility Something will be/is intentionally broken labels Jul 31, 2019
@sebastianbergmann sebastianbergmann added this to the PHPUnit 9.0 milestone Jul 31, 2019
@sebastianbergmann sebastianbergmann self-assigned this 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/backward-compatibility Something will be/is intentionally broken
Projects
None yet
Development

No branches or pull requests

1 participant