Hi again,

El 05/07/2009, a las 22:59, Miles J escribió:

> Well firstly id like to know why you are importing and initiating
> controllers?


Unit-test controllers using this methodology:

http://mark-story.com/posts/view/testing-cakephp-controllers-the-hard-way

Classregistry works as intended for me except when testing plugins.

As far as Controllers load Models using Classregistry, many of my test  
failed beacause Models were instantiated as AppModel instead of the  
proper class. I discovered that I could workaround this problem doing  
an explicit App::import('Model', 'Plugin.Model'). Then the controller  
is able to load the right class.

I detect the problem when trying to test models with attached  
behaviors (in fact, behaviors weren't attached at all).

Reading the Core test case for Classregistry doesn't clarify the  
question for me. I need to study how to prove this issue in a more  
general fashion.

Thanks.
---
Fran Iglesias <[email protected]>
http://cakephpilia.blogspot.com


--~--~---------~--~----~------------~-------~--~----~
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