This article covers installation and use of the PHPUnit2 pear module, and discusses how to test your applications at the module, DB and interface level. This is a good read, especially for those of you who must deploy tested, solid applications.
http://www-128.ibm.com/developerworks/opensource/library/os-php-unit/