-
-
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
Remove MockBuilder::setMethods() and MockBuilder::setMethodsExcept() #3769
Comments
|
Also interested in this ^ |
I second the latest comments, supporting the need of With this comment in mind @sebastianbergmann, I agree in a test suite you consider a class/object as the unit under test, however I'd also argue that in a specific test of that suite you might (often?) test only part(s) of that object, as in maybe one or few methods at a time. Allowing to mock some of the other object's methods allows to perform those tests in isolation. I wonder if the approach I just mentioned does make sense to you or if you had any thought or suggestions on that. |
I usually mock the whole SUT, except the method I'm testing. The removal of Restoring this functionality would be a real plus. |
What is the reasoning behind completely removing setMethodExcept and not having any alternative? For example Yii1 have CActiveRecord classes which do a lot of things as soon as you instantiate it. You can mock it fine, but then how can you actually have a real test of the methods that you have designed yourself inside this class?. |
See #3687 (comment) for details.
The text was updated successfully, but these errors were encountered: