-
-
Notifications
You must be signed in to change notification settings - Fork 19
Support PHPUnit 12 by avoiding removed methods getMockForAbstractClass() and addMethods() #75
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
Support PHPUnit 12 by avoiding removed methods getMockForAbstractClass() and addMethods() #75
Conversation
…s() and addMethods()
I guess the |
1f67e1a
to
6a35727
Compare
Needs the changes in php-mock/php-mock-integration#13 for the tests. |
OK, now the tests are finally passing. 🙂 I'll check Mockery and Prophecy next, to (hopefully) enable a stable release of php-mock/php-mock-integration. |
@michalbundyra, the tests in php-mock/php-mock-mockery and php-mock/php-mock-prophecy pass using php-mock/php-mock-integration 2.5.0-beta1, without any code changes. So it looks like the changes in 2.5.0-beta1 are breaking only for php-mock/php-mock-phpunit. If this is enough in terms of testing, I think the remaining steps would be:
|
@crocodele huge thanks 🙇 |
This is an attempt to address #71 and support PHPUnit 12 by removing the use of the PHPUnit methods
getMockForAbstractClass()
andaddMethods()
that were deprecated in PHPUnit 11 and removed without replacements in PHPUnit 12.It relies on a change in php-mock-integration, making the mock class non-abstract and adding an actual function that can be mocked using
onlyMethods()
. See https://github.com/php-mock/php-mock-integration/compare/master...crocodele:feature/SupportPhpUnit12?expand=1.I haven't looked into the effects on php-mock-mockery and php-mock-prophecy, but can return to that if the general approach seems OK.