Hi Sonic,

I'm glad you found the code I linked to interesting. It's not really all the great yet either, but it helped me to get a better understanding of how testing could be done within CakePHP.

Right now I started working on my own little testsuite which I don't intend to be a competition with the one dhofstet is working on, but rather an object of study for myself. When I'm done with it I'll probably join dhofstet's efforts on developing an 'official' testsuite. But right now I'm still not sure what kind of tests I think are the most useful within CakePHP.

Over in railsland they don't do any UnitTesting with Controllers at all, but rather functional testing. Now while that might not be as deep of a test, I'm trying to make the decision if it's just good-enough. Because once you start getting into mocking models & components for every controller, simulating mock responses, you end up doing  *tons* of work for your testing. But if you decide to do UnitTesting on the Models/Components you should be able to assume they work, and just see/test how the Controller plays together with them. That approach just seems a lot more agile to me and I'm leaning more torwards it then towards the Mocking/UnitTesting approach for Controllers.

What do you think?

Best Regards,
Felix Geisendörfer aka the_undefined


Sonic Baker wrote:
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, especially since I've thought about doing it a few times before. For some reason it didn't come to me when actually at the time (probably due to the continuing lack of sleep). So to yourself and teemow, thanks for the link to the helper. Before I get bogged down in errors though, does it work with SimpleTest? While we're on the subject, will your test suite be based on SimpleTest?

Since I couldn't get my controllers tested, I've been playing around with safety with model tests. I've made a very dirty class for this purpose which can be found here:
http://www.cakephp.org/pastes/show/99b95734fbb3b5a90d9b20adbc381aa9

Please excuse it's non-cakeyness. I didn't bother to make it better as I wasn't sure till this morning if it was a good idea or not. Dhofset had a look and recons it's not a bad idea so I'm in the process of replacing the mysql specific functions with cake's DBO model methods.
Here's a snapshot of my progress so far:

http://www.cakephp.org/pastes/show/87303c2af5b1c8af35e3fe4ab5ed8e35

Please excuse the mess as I've been up all night and am starting to hallucinate with tiredness :-? At this stage I'll live with the embarrassment if I could get an opinion.
I'm looking for a cake-ier way to read a MySql dumpfile and parse it. As you'll see the existing method doesn't even pretend to do this.

I'd really appreciate some feedback with this from anyone who's interested.

Cheers,

Sonic




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to