NYCPHP Meetup

NYPHP.org

[nycphp-talk] Testing PHP with Perl

Chris Shiflett shiflett at php.net
Wed Oct 27 22:59:18 EDT 2004


Geoff has posted our slides from last night's talk as well as a tarball
that you can play with:

http://www.modperlcookbook.org/~geoff/slides/nyphp/

I hope everyone enjoyed the talk. There was a lot to talk about, so I know
it was hard to follow everything, especially since this is all very new
(even if you do a lot of testing already). Hopefully reviewing these
slides will help, and I plan to generate some better documentation once
we're further along.

If you want to play with the tarball, just follow the steps in the INSTALL
file (it even gives you an example set of steps for installing Apache with
PHP, which you can probably skip). The sample application lives in
t/htdocs, and the tests are all *.t files within t. Examples of tests
written in PHP exist within t/response/TestFunctions.

Lastly, as I've looked more into Simple Test and PHPUnit, these seem to
only be simplistic functions that can help you write unit tests (similar
to Test::More in Perl), but they provide no automated way to run these
tests nor an easy way to create a good test environment that resembles
production (testing from the command line? Yuck!). I'm not suggesting that
they've ever claimed to be more - I just wasn't sure. Until now, they've
been our best options for testing PHP applications, but no longer. :-)

Because PHPUnit and Simple Test seem like good approaches to unit testing,
and because there are likely many developers who have a lot of tests
already written in these, I will probably write a compatability layer that
implements the same tests but with Test::More compatible output, so that
people can easily port tests to the Apache-Test framework.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly     HTTP Developer's Handbook - Sams
Coming December 2004        http://httphandbook.org/



More information about the talk mailing list