Skip to content

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