is there any testing framework for CI? |
[eluser]gluis[/eluser]
hi ci hackers, i come from a world where test:code coverage is pretty important for applications (especially for client apps), and i can't seem to find any mention of functional testing for ci. the user's guide has some example unit testing samples, but i'm looking for more extensive tools. what am i missing? where's a good place to find this info? thanks! gluis
[eluser]frietkot[/eluser]
Have you tried the unit test library? http://ellislab.com/codeigniter/user-gui...sting.html
[eluser]gluis[/eluser]
thanks, frietkot. i did see that (i mentioned it in my post). but i was looking for a bit more than that--though that's still not bad. ;-)
[eluser]gluis[/eluser]
no, i haven't. i just started playing around w/ CI. i looked at it months ago, but never did anything. now i'm starting to learn it just in case i need to build something for an EE build early next year (assuming EE 2 is out). but i'll definitely look into it. thanks for the tip! (any bit of info helps me assemble a little testing environment to do TDD if i can) ;-)
[eluser]JensRoland[/eluser]
You may want to check out my new JUnit-like unit testing suite, Toast: Features: * lightweight and unobtrusive - the entire suite has just 2 code files, and one of them is optional ;-) * works with CI with no changes - just drop it in and it works * simple JUnit-style syntax * works entirely in the browser - no need for shell access * run single tests, sets of tests, or all tests at once (all in the browser) * auto-benchmarking using CI’s benchmarking class An example of the way you write tests in Toast: Code: require_once(APPPATH . '/controllers/test/Toast.php'); Anyway, I’ve put the source code up for download from my site, along with a simple user guide. Toast v1.1 - Unit Testing suite for CodeIgniter I’m hoping it'll make it a little bit easier for people to do proper Test-Driven Development in CodeIgniter. All the best- /Jens Roland
[eluser]onblur[/eluser]
UPDATE: Scrub that - forgot to set base url in config. :roll: Is working perfectly!!! Hi Jens, thanks for contributing your TOAST unit testing suite. I've been trying it out. Works great for me when running test classes or individual test methods e.g. Code: http://localhost/index.php/test/example_tests These work fine. But if I run toast_all I get errors. Code: http://localhost/index.php/test/toast_all outputs... Code: Toast Unit Tests:
[eluser]salbertson[/eluser]
I am running into this same problem. Did you ever figure out what was wrong?
[eluser]onblur[/eluser]
Has been a while since this - I can't recall exactly the details. From memory, it was working fine for me. My reference to the base_url in the config probably refers to settings in the testing framework rather than CI. Sorry can't be more specific - memory fails me.
[eluser]salbertson[/eluser]
Thanks, I figured it out. It was a combination of the base_url in config and the router was looking for toast_all.php in lowercase, not Toast_all.php that comes with the library. Simple fix and now it works great. |
Welcome Guest, Not a member yet? Register Sign In |