I wrote a replacement for testAction that does it the Mark Story way.
You can find info here:
http://42pixels.com/blog/testing-controllers-the-slightly-less-hard-way

It uses what I learned from Mark and Matt and kind of combines that
information into something a little more DRY. It also allows you to
use Mocks and read directly from the models after testing the action.

hth,
jeremy


On Aug 10, 12:37 pm, Hugo M <[email protected]> wrote:
> I found a pseudo-nice way in this 
> page:http://www.scribd.com/doc/19344870/Super-Awesome-Advanced-CakePHP-Tips
>
> 2010/8/10 Hugo M <[email protected]>
>
>
>
> > I've seen tutorials about using mock objects but I want to use the function
> > testAction, and the tutorials I've seen don't use that funcion.
>
> > They create its own functions and instanciate controllers and I think
> > that's not the cakephp way. (sorry for my bad english)
>
> > 2010/8/10 Hugo M <[email protected]>
>
> > How can I set Auth->user object in a controller when I'm testing it?
> >> Because I need logged in user id { $this->Auth->user('id') } in some
> >> functions :S

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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