Re: Testing controllers with SimpleTest revisited

2006-08-30 Thread [EMAIL PROTECTED]
I was also getting that same error. It seems the model is already loaded, so you dont run the loadModel() function.All I did was the following: $object = new Blog; pr($object-findAll()); Simple ;) Hope it helps you. --~--~-~--~~~---~--~~ You received this

Testing controllers with SimpleTest revisited

2006-08-22 Thread Sonic Baker
I know the issue of testing controllers with SimpleTest has come up before but unfortunately has gone unanswered. I'm hoping that in the time that has passed it has been figured out. Testing models works fine but controllers on the other hand is a hazy area. The first problem is actually

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread [EMAIL PROTECTED]
loadmodels? http://api.cakephp.org/basics_8php-source.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread Sonic Baker
Hi Dieter, Thanks for the reply. Unfortunately adding loadModel('Blog') to the after the laodController gives a redeclaration error: Fatal error: Cannot redeclare class blog in /path/to/cake/app/models/blog.php on line 142 Any more ideas? Cheers, Sonic

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread [EMAIL PROTECTED]
if it says that you are redeclaring it, you are probably loading it twice eg trying to load it manually while it's already loaded automatically. are you sure you need to load it manually? --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread Felix Geisendörfer
Hi Sonic, Testing Controllers is a very important topic to me right now as well. I've been talking about it on my blog lately and I've also put some of the code I use to make testing controllers easier in the cakebin. However, that's not really what you are looking for, since I'm not using

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread teemow
hey sonic, there is a test helper which creates mock objects for all the models of a controller. http://cakephp.org/pastes/show/8803bd09150cb65cc7da63f92cdbc828 felix' post: http://www.thinkingphp.org/2006/08/17/agility-divide-and-conquer-what/ cheers, timo

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread Sonic Baker
Hi guys, Thanks for your responses, much appreciated. Thanks v much for the links, very interesting. @Felix, I'm definitely one of those people in your divide and conquer blog. I'm also trying my best to become agile. I can't believe I didn't think to mock the Models when in the controller,

Re: Testing controllers with SimpleTest revisited

2006-08-22 Thread Sonic Baker
Hi Felix, Thanks for your reply. I haven't really played around with Mocks that much myself but everything I've read about them is positive in the sense that when using Mocks with TDD, you are forced to think more in terms of interactions between objects, which leads to a better design with less