User:Tgr (WMF)/Mocking

Problems with PHPUnit (pre-Prophecy)

 * multiple invocations of the same method are hard to specify (need to know the exact invocation number)
 * partial behaviors are hard to specify (e.g. do this when called with these arguments, otherwise behave normally)
 * mixes fixture setup and assertion verification
 * dual inheritance makes type hinting impossible
 * complex, unintuitive syntax
 * poor documentation (not sure the alternatives are any better though)

Alternatives
Some alternative mocking frameworks: Phake, Prophecy (included from PHPUnit 4.5), Mockery, Phockito