Related link: http://shiflett.org/archive/169
Admit it - deep down inside, you know you should be testing your PHP applications. With all of the different PHP test environments and the daunting documentation, sometimes it is difficult to know where to start. This tutorial will help. The first step in testing is deciding what to test, so we will begin by offering a very simple (but not contrived) PHP application with identifying elements that lend themselves to testing - both unit tests and functional tests. Next, we will write some real tests using several of the existing PHP testing frameworks, including PHPUnit, Simple Test, phpt, and Apache-Test.
Unfortunately, testing hasn’t really caught on in the PHP community for some reason, despite the existence of several useful tools and resources:
- PHPUnit Pocket Guide
- Simple Test
- Simple Test Tutorial
- phpt Tutorial
- Apache-Test Demo
- Apache-Test Skeleton
- Apache-Test Support for Simple Test
Do you test?