Chris Hartjes Blog: Testing Controllers Hiding Behind Zend_Auth
Chris Hartjes has written an article on how to test Zend Framework controllers which are protected by Zend_Auth.
I found quite a few examples on how to test a controller, using the $this->dispatch(‘/path/to/action’) method but found that I wasn’t getting redirected properly to the post-login page. I was passing proper credentials in and everything. Then finally after deciding to go back to basics and read up on just how to test Zend_Auth. After some swearing a few face-palms, I realized what I had been doing wrong.
The then goes on to explain how you should do it by ensuring that the unit test logs in via Zend_Auth and provides code to show how it all fits together.

