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

@DFoxinator DFoxinator commented Aug 2, 2019

No description provided.

@DFoxinator DFoxinator force-pushed the onlymethodsblankarray branch from f4659b2 to 783def7 Aug 2, 2019
@DFoxinator DFoxinator force-pushed the onlymethodsblankarray branch from 783def7 to ae94283 Aug 2, 2019
@DFoxinator
Copy link
Contributor Author

@DFoxinator 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.

Loading

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

Successfully merging this pull request may close these issues.

None yet

2 participants