You may want to just browse around some plugins that you use to see what's 
tested, or even the core tests. They give you a good idea. Basically you 
want to test against certain scenarios to make sure your code can handle 
them properly. Sure, if you *just* use baked code there's not much to test 
(but it's still a good idea to write them to even make sure your db setup 
works w/ the baked code).

For example, I have a method in my Group model that is a convenience for 
finding groups when compared to another group. For example, finding all 
groups of higher or equal permission to a certain group, finding groups 
less than a certain group, etc. I'm using ACL so the Groups are AROs and 
therefore a tree. My test case includes several assertions to make sure the 
method pulls the correct list of groups, as well as assertions that deal 
with handling missing parameters, etc.

Basically when you're writing tests, you want to cover as many 
possibilities to be sure your code won't bug out. It's especially important 
when handling user input, for example, /posts/index/2 - what if the user 
types /posts/index/all ? How should your code handle it?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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