phpspec / prophecy

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

How to enforce `shouldBeCalledX` definition? #563

Closed tyteen4a03 closed 1 year ago

tyteen4a03 commented 2 years ago

My team would like to ensure all prophecies made all include the shouldBeCalled predicate. Is there an option to validate this in Prophet::checkPredictions()?

stof commented 2 years ago

No, because checkPredictions checks the predictions being done. It has no way to know about cases where you would have liked to make one but forgot. This is a job for a linter or a custom static analysis rule, not for a runtime check.