Thank you Jeremy... I've just started to write TestCases to my main models,
where's what I did:

   - Created fixtures based on database schema + provided data inside the
   fixture
   - Test the model object to see if it's an child of AppModel and Model
   - Test some finds
   - Test the new method that i create to run some special find conditions
   - Test if the model has the needed behavior
   - Test if the model has the related model on belongsTo/hasMany

What do you think about those testcases? Do you suggest anything different?
I just have the models and the tables now, didn't started to create the
controllers and etc.

I will use this post to ask future questions regarding this kind of tests ;)

Thanks for your help!

Regards,
--
***Thiago Belem*
Desenvolvedor
Rio de Janeiro - RJ - Brasil

+55 (21) 8865.9250
thiagobelem.net
cont...@thiagobelem.net

*Skype / gTalk **»* thiago.belem.web
*LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt*
Assando Sites*, curso de CakePHP *»* assando-sites.com.br


2011/11/15 jeremyharris <funeralm...@gmail.com>

> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to