Unit Testing for PHP Simplified with Jason Hinkle
Details
Speaker: Jason Hinkle (https://twitter.com/jasonhinkle), CTO, Eventric (http://www.eventric.com/)
You know that you should probably be running automated tests. But who has time to set it all up? Getting everything going is a pain and there’s no way to write tests for your legacy codebase anyway. Sound familiar? PHP has grown up along with the web itself, but unlike other languages, unit testing was not always a major part of PHP culture. Luckily, PHP has excellent tools for automated testing and they keep getting easier to use. The hard part is figuring out how the various pieces fit together and wading through the scattered documentation. Legacy code can make this even more intimidating with no clear path to get started.
In this presentation, we’ll start with some basic unit tests and progress to more advanced integration testing. We’ll generate code coverage reports that show exactly which lines of code have been tested. We’ll create some integration tests using a GUI that’s as simple as recording an MS Word macro. Finally, we’ll set up a fully automated test harness using a headless browser that can automatically test any PHP code, no matter how it was written. The tools used in this presentation are PHPUnit, Selenium WebDriver, Selenium IDE and PhantomJS.
