I'm having problems setting up a mocked controller for testing.

I generated the partial mock with the following:

Mock::generatePartial('AccountsController',
                      'MockAccountsController',
                      array('redirect'));

Then in the startTest method of the CakeTestCase, I did this:

        $this->Accounts = & new MockAccountsController();
        $this->Accounts->autoRender = true;
        $this->Accounts->__construct();
        $this->Accounts->constructClasses();

This still redirects me to another page when the redirect method is called.

Can anyone shed any light on testing controllers that contain calls to
redirect functions?

Does anyone have any examples of testing their controllers using this
method or any other way?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to