This talk will look at how PHPUnit and Prophecy compare when using mock objects to unit test PHP code. Whilst PHPUnit is the standard test library for PHP, Prophecy is a good alternative for generating mock objects and has been included within PHPUnit since version 4.5.
The talk will start by introducing the use of mock objects in unit testing and define four types of test double : dummy, stub, mock and spy. The main part of the talk will then concentrate on how each of these types are implemented; firstly, using PHPUnit, and secondly, using Prophecy. The talk will conclude by discussing when a developer might use Prophecy mock objects and when PHPUnit mocks might be more appropriate.