Following last month's
article by
Ian, here's some thoughts on how to test a Zend Framework application.
One of the unit testing best practices suggests to
break dependencies, so you can test each component separately.
The first problem that arises when you want to test
controllers might be having a tighter control over the
HTTP Request and
Response objects. Fortunately, ZF already has something that really makes your life easier, i.e. the
Zend_Test_PHPUnit_ControllerTestCase class, which has stubs for the Request and Response
objects, and you can easily check headers, return codes, routes, redirects, and even the view itself.