Testing Forms in PHP with SimpleTest
Mar 03, 2011, 11:06 (0 Talkback[s])
(Other stories by W. Jason Gilmore)
WEBINAR: On-demand webcast
How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >
"Encouraging best practices within the PHP community through the
adoption of powerful tools such as Phing, PHPUnit and FirePHP was a
major focus of my 2010 contributions to Developer.com and
PHPBuilder.com. Much to my delight, interest in these articles was
so strong that I'll be regularly returning to more
productivity-boosting utilities throughout 2011, starting with the
SimpleTest unit and Web testing framework.
"Although not as well known as PHPUnit, SimpleTest is an
immensely capable framework, having been adopted by popular PHP
projects including CakePHP and Drupal. In addition to offer a
complete suite of unit testing capabilities, SimpleTest is bundled
with an internal Web browser which you can use to automate the
navigation of your Web site and perform tests such as completing
and submitting Web forms much in the same way a typical user would.
In this tutorial, I'll show you how to use SimpleTest to automate
these otherwise tedious tasks.
"Download SimpleTest by heading over to its SourceForge page and
downloading the latest stable version. Once downloaded, unzip the
package to a convenient location and add its path to PHP's
include_path. After restarting your Web server, you can make sure
SimpleTest is accessible from a PHP script by creating a PHP script
which contains the following code:"