Skip to content

Instantly share code, notes, and snippets.

@andyfowler andyfowler/
Last active Aug 29, 2015

What would you like to do?
Frustrating landscape of PHP mocking

Why are PHP's mocking libraries so weak?


Kludgy, disgusting syntax.


Seems to have the most momentum, but I don't like its DSL, which seems more complex than 95% of cases need. Bad docs: a 1,600-line README?


Dead-simple syntax (four public methods to remember) and the ability to mock non-dependency-injected code. Heavy overhead in the AOP framework it relies on. But this is still the library I'm liking the best.


Nicer verification (like spies), but stubbing syntax is as bad as mockery. Bad docs.


Come on!

Oh come on! Who's inventing this stuff?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.