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

onlyMethods/addMethods - blank arrays fix #3781

Merged

Conversation

DFoxinator
Copy link
Contributor

No description provided.

@DFoxinator
Copy link
Contributor Author

DFoxinator commented Aug 2, 2019

@sebastianbergmann I was implementing these into a large test suite manage, and I came across this issue/behavior that I think is broken. It doesn't seem like expected behavior that onlyMethods([]) would result in all methods in the class being mocked. I think the correct behavior is no methods should be mocked because you're saying mock onlyMethods with a blank list. This functionality becomes more critical for when createPartialMock uses onlyMethods instead of setMethods. Because as-is, the behavior of mocking no methods on the class would break when the switch is made.

Please let me know what you think.

@sebastianbergmann sebastianbergmann merged commit 519eb84 into sebastianbergmann:8.3 Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants