phpspec / prophecy

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

How to test only one Class method #421

Open kickthemooon opened 6 years ago

kickthemooon commented 6 years ago

If I understood Prophecy correctly then...

Then I cannot test an objects method if there is no "messaging" i.e. more objects involved?

Like

DonCallisto commented 6 years ago

If the object is a double (Prophecy), you cannot invoke the REAL code onto it. It is just a double, not a “partial mock/stub”

Prophecy won’t make you use a collaborator this way.