An introduction to using mocks and stubs in your tests. We'll be using PHPUnit (although the concepts are applicable to other testing frameworks and languages).
Mocking and stubbing workshop
Dave Liddament