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

Tests: investigate alternatives for mocking #814

Open
jrfnl opened this issue Jun 26, 2023 · 0 comments
Open

Tests: investigate alternatives for mocking #814

jrfnl opened this issue Jun 26, 2023 · 0 comments

Comments

@jrfnl
Copy link
Member

jrfnl commented Jun 26, 2023

The functionality within PHPUnit itself to mock classes and set expectations on them is being deprecated left right and center, with each upcoming PHPUnit version needing more work-arounds.

While Requests doesn't use mocking much (at all), it is used in a few select places and keeping that working is getting more difficult and will probably become impossible come PHPUnit 11/12.

Typical issues:

  • setMethods() was deprecated in PHPUnit 8.3 and removed in PHPUnit 10.
  • The alternative addMethods() was deprecated in PHPUnit 10.1 and is expected to be removed in PHPUnit 12.
  • The getMockBuilder() method is deprecated and is expected to be removed in PHPUnit 12.

It should be investigated if using Mockery would be an alternative (once it is available with support for PHPUnit 10).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant