sebastianbergmann/phpunit — Issue #509: Document setMethods(null)
Author: bskendig
Created: 2012-02-23 15:03:06+00:00
State: open

The PHPUnit call "setMethods()" can be called with "null" as an argument if you don't want to mock any methods on an object. This is useful if the only purpose you're mocking an object is so you can avoid calling its constructor, and you need to call a real method on that object to test it. See "http://stackoverflow.com/questions/9398284/creating-a-mock-in-phpunit-without-mocking-any-methods" for a discussion on this.

setMethods(null) isn't covered in the PHPUnit documentation, however, and it took me a long time to discover this useful functionality. Would you please give it a mention in the documentation?