Skip to content

Instantly share code, notes, and snippets.

@andyfowler
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyfowler/9041816 to your computer and use it in GitHub Desktop.
Save andyfowler/9041816 to your computer and use it in GitHub Desktop.
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