Deprecating createPartialMock with unknown methods: How should __call() be mocked?
Hi, we are using PHPUnit to mock out the Predis client. As the client is a fairly thin layer above the redis protocol the client the implementation uses __call() quite a lot to allow for as many methods as possible.
When upgrading to PHPUnit 9.5 this now triggers a deprecation warning. I would like to ask for this functionality to be kept. Being able to stub the code directly instead of having to create a wrapper has a few pros in this case:
- It is more obvious what is happening at the call site
- We avoid wrapper code that will require maintenance
- The mocking library can be used to test and stub out interactions before implementing them.
I get that you want Phpunit to point people in the correct direction with regards to testing, but it would be nice if this could be done while leaving an escapehatch open - something like React's __dangerouslySetInnerHtml - instead of removing the functionality completely.
Regards, and than you for PhpUnit.