PHP in Action shows how to test an action controller
Dagfinn Reiersøl, the author of PHP in Action, has recently posted an article about how to test a Zend Framework action controller. He uses SimpleTest, but the ideas will work equally well with PHPUnit if that’s your preferred testing framework.
It’s a good read and once you’ve read it you should buy his book!


Matthew Weier O'Phin responded on 12 Jun 2008 at 6:28 am #
As noted in a comment on that post, I’ve been developing a functional testing framework for ZF MVC applications. The proposal can be found here: http://framework.zend.com/wiki/display/ZFPROP/Zend_Controller+Testing+Infrastructure
and working and tested code can be found here:
http://framework.zend.com/svn/framework/standard/branches/user/matthew/mvcTesting
This goes a lot further than Dagfinn’s example, as it takes into consideration the bootstrap, any _forward() actions, and has a comprehensive set of assertions for response headers and content.