Testing PHP

01 Dec 2004

I guess this is my belated ApacheCon blog. I had a lot of fun as usual, and I got a chance to meet a few new people and hang out with old friends. The talk that Geoff and I gave went really well, and it ended up being as funny as we had hoped. More exciting than the talk is the project behind it. I think we've created a really nice testing framework for PHP applications, and I'm going to try to describe it for those who missed the talk.

There are a couple of resources available for download:

What's so great? Apache-Test - a testing framework for Apache that adheres closely to strict testing ideologies. Geoff and I have added features to Apache-Test that let you use it to test PHP applications. In addition, we have provided a PHP implementation of Test::More - a popular CPAN module that has some very simple functions that make writing tests easy.

The idea for this project began at OSCON, where Geoff and I were discussing testing tools and methodologies. The Perl community has embraced testing as a key component of a developer's skillset, whereas the PHP community still relies heavily upon echo and manual testing with a browser. Since Geoff is a Perl guy, I'm a PHP guy, and we happen to be good friends, we decided to create a way to let PHP developers benefit from Perl's mature testing tools and methodologies. Since Geoff is really a mod_perl guy and interested in all things Apache, he is a big fan of the Apache-Test framework. This seemed like a great tool to provide to PHP developers, so we proposed a talk about it. Once the talk was accepted, we had to deliver.

What makes Apache-Test so great for PHP developers? It provides several key features not available (to my knowledge) with any other testing framework:

These are the major features (that I can think of) that I find particularly appealing. I'm sure there are others. Perhaps a nice side-effect is the potential for cross-pollination between the Perl and PHP communities.

If you're interested in learning more, please download the demo and the slides from our talk. To run the demo, you'll need Apache-Test 1.16 or greater. You can find the most recent version from search.cpan.org.

This testing framework is only available for Apache.