Mocking Dependencies in Unit Tests with Phake

elazar

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 mocking API leaves 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.

Session Track

PHP

Experience Level

Intermediate

Drupal Version