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

Support methods prefixed with underscore #553

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neclimdul
Copy link
Contributor

Fixes #108

While it was a common convention to prefix "private" methods with an underscore
in earlier version of php, with support for method visibility this is no longer
common.

Additionally there are a number of exception such as the Soap library where
this convention did not hold and code was not mockable.

@ciaranmcnulty
Copy link
Member

I wonder if we'd need to do this in a major or not? I guess nobody's relying on 'methods that can't be mocked'?

@borisson
Copy link

borisson commented Aug 9, 2022

I wonder if we'd need to do this in a major or not? I guess nobody's relying on 'methods that can't be mocked'?

I don't think this warrants a new major either, this behavior shouldn't make a change to anyone actually writing tests.
Only when they are doing some meta testing to see how many mockable methods a class has or something and even when typing it here, that gives me a headache ;)

Fixes phpspec#108

While it was a common convention to prefix "private" methods with an underscore
in earlier version of php, with support for method visibility this is no longer
common.

Additionally there are a number of exception such as the Soap library where
this convention did not hold and code was not mockable.
@neclimdul neclimdul force-pushed the support_mocking_underscore_methods branch from c9d1655 to 219e572 Compare May 16, 2024 17:43
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.

Cannot mock methods begining with underscore
3 participants