Wednesday, December 30, 2009

Creating tests for bake tool

Hello everyone,

So I wanted to try to contribute to the cake core, and I had an idea for a (trivial) update I could make.   One change is to the bake script to output a more "edit" friendly version of the validation info.

The other change is in the field detection for bake.  Right now it just checks if $fieldName === 'email', which means email_address, user_email, and other variations are not picked up.  I modified it to check strpos($fieldName,'email')!==FALSE to pick up the variations, as well as adding a check for strpos($fieldName,'phone')!==FALSE as well.

I am not familiar with testing at all, but I know I should create some test cases before attempting to submit this patch to show that this change works as intended.  How would I go about creating a test case for this part of the cake core?

Thanks any advice is greatly appreciated!

Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: