Skip to content
< Matthew Turland />

Mocking Dependencies in Unit Tests with Phake


Reports of the death of TDD have been greatly exaggerated. All but the most trivial of applications make use of the OOP principle of composition and as such require mocking of dependencies in unit tests. While PHPUnit has become the de facto unit testing framework for many projects, its bundled mocking API can leave something to be desired. This presentation is an introduction to Phake, an alternative mocking library with a more concise and intuitive API and a more substantial feature set that removes the headaches from mocking.