phpspec / prophecy

Highly opinionated mocking framework for PHP 5.3+
MIT License
8.53k stars 241 forks source link

Support methods prefixed with underscore #553

Open neclimdul opened 2 years ago

neclimdul commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 ;)