Speaker Deck

Testing Wizardry: How Mocks and Fixtures Can Save Your Sanity

by Jeff Carouth

Published October 25, 2012 in Programming

Writing tests is easy. Writing tests that are thorough is hard. How do you test in isolation? It is a tough question when you start your testing journey, but with mocks and fixtures you too will be writing impressive and useful tests. In this talk we will explore native PHPUnit techniques for creating mocks and stubs, Phake and Mockery for enhanced mocking in unit tests, Phactory for fixture generation in unit tests, and Phabric for feature tests with Behat. At the end of this talk you will have gained knowledge of how and when to apply mocks and fixtures, and will be on your way to being a testing phreak.