On his blog today Chris Hartjes has a new post about testing your Zend Framework application's functionality that lives behind a Zend_Auth authentication.
The initial problem though was how do I simulate logging in a user so I can see this page, which was protected by authentication using Zend_Auth. So I started my scouring the internet for answers.
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.
He includes the ultimately successful code for the test that uses a "loginUser" method to handle the authentication and ensure that the user is correctly logged in.
“The team at Blisstering took personal pride in their development work, even to the point of augmenting the product with improvements and enhancements in order to deliver the best solution possible.”
Gale Wilson-Steele
Founder and CEO
CareSeek
“It was my first time using a website development company, and as much as I apprehended the whole process, it could not have been easier. At Blisstering, they made the whole process much less threatening than it seemed by being pleasant, cooperative, helpful, creative. They were quick to start work on our CRM solution, and to get it to completion -- on-time and on-budget. I love the final result! I strongly recommend Blisstering Solutions, and with pleasure.”
R. R. Shah
International Marketing Corporation