I am trying to get my head around unit testing controllers in CakePHP
1.2 and I have some questions as the documentation is a little thin on
the ground.
1) When using $this->testAction() does the URL have to be in the
format "/blog/index" or could I use "array('controller' => 'blog',
'action' => 'index'). In addition that how I would test a route such
as this?
Router::connect(
'/:lang_code/blog/view/:id',
array('controller' => 'blog', 'action' => 'view'),
array('lang_code' => '[a-zA-Z]+', 'id' => '[0-9]+''
);
2) Does testAction() also invoke any beforeFilters for that
controller? I have a lot of logic in the beforeFilter for language
detection, which most controllers and actions require to run properly,
and hence to test properly.
Matt
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---