-- zpc <zpcha...@gmail.com> wrote
(on Wednesday, 01 April 2009, 12:21 AM -0700):
> I'm having some problems with redirects while unit testing a controller. 
> I'm trying to test a simple login form, and while the code block containing
> the redirect line is being executed, the program continues onward and ends
> up running the fallback redirect at the end of the action method instead. 
> When I manually test the page it works just as it should.  

Whenever you _forward() or redirect, you should return immediately. As
an example:

    if (!$form->isValid($request->getPost())) {
        return $this->_forward('details');
    }

If you don't, the action continues to process. This would definitely
have an impact on redirects as well.

-- 
Matthew Weier O'Phinney
Software Architect      | matt...@zend.com
Zend Framework          | http://framework.zend.com/

Reply via email to