Advice on TDD / Unit Testing Class |
[eluser]Buso[/eluser]
I have just heard of TDD and remembered CI's unit testing class (which I have never used). I wanted to know if it has been useful to you. Are you doing TDD? (whether with or without CI) Is there much to learn about this? I know CI's unit testing class is quite simple, but maybe I should research further if I want to be a better developer and start using it?
[eluser]Eric Barnes[/eluser]
Yes the internal one is very basic but should give you an idea on how to start testing. I have actually ported simpletest and released this: http://github.com/ericbarnes/codeigniter-simpletest
[eluser]Buso[/eluser]
that looks amazing, how come I never heard of these things before T_T thanks
[eluser]Buso[/eluser]
So.. what am I supposed to do with this unit testing class? (the codeigniter one I mean) I have been thinking but nothing came out I must write separate files for the tests I guess, and maybe a test controller that gathers all the tests and runs them? A simple example would be helpful (not necessarily coded) I just wanna know the most basic usage for this, as I never used it
[eluser]Eric Barnes[/eluser]
With the ci unit testing I just create a controller and then add all my tests in it. It is very lacking if you need more than just a few simple tests.
[eluser]Buso[/eluser]
edit: SOLVED. Had to require it from index.php, not sure why. Simpletest makes my apache crash when I require autorun.php from within my controller. Any ideas?
[eluser]Buso[/eluser]
yay! I finally completed my own simpletest integration here's a screen: http://img248.imageshack.us/img248/5278/mytestsuite.jpg development is just getting more awesome :lol:
[eluser]Rey Philip Regis[/eluser]
Hi Eric, Im using your Test Suit Library for CodeIgniter right now. I have a question, how do I test a controller? Good day. |
Welcome Guest, Not a member yet? Register Sign In |