lundi 21 septembre 2015

PHPUnit - Test if method is called WITHOUT actually calling it?

In the method I want to test, an object is being created which is then stored in the database with save(). I do not want the method save() to actually run because it may break my database because of the test values, but I do want to test if this function is being called.

Is there a way to test if a method of a class is being called WITHOUT actually do the call?

Note; the company I work at strongly prefers Prophecy, but if it is only possible with the Mock library, please tell me this too.

Aucun commentaire:

Enregistrer un commentaire