Continue the discussion

Published

November 19, 2014

Trust me, maintaining software is sooo much easier when you have unit tests to let you know when changes meet their goals or introduce new bugs. PHPUnit is the standard suite for testing and analyzing PHP code. But getting PHPUnit working with a WordPress plugin is challenging. This presentation explains the unit tests created for the Login Security Solution plugin. How to mediate the conflict between WordPress’ heavy reliance on globally scoped variables (groan) and PHPUnit’s squashing of global variables
How to test calls to wp_mail(), wp_logout(), wp_redirect()
How to continue execution after PHP produces expected errors
Verifying database inserts that have auto-increment ID’s

Rate this:

Event

WordCamp NYC 2014 58

Speakers

Daniel Convissor 1

Tags

unit testing 27

Language

English 11384

Download
MP4: Low, Med, High, Original
OGG: Low
Subtitles
Subtitle this video →