[eluser]t'mo[/eluser]
[quote author="drizz815" date="1208000467"]Am I right in thinking that you finish up with a test file per model, each test starts with "test" (you can add helper functions), and you run each test file separately from the browser?
What do you do about setUP and tearDown? My current test harness is resetting my test DB with sample data so I can test for successful changes.
How do you test your user interface?[/quote]
Q1: Yes.
Code:
class FooTest extends MY_TestController
{
...
function test_SomethingOrOther() {
// this code will be invoked by MY_TestController::index()
...
}
...
function non_test_code_may_be_a_helper() {
// this code will *not* be invoked by MY_TestController::index()
}
...
}
About running each test file in a browser, I'll have more on that in Part II (when I get around to writing it...but in case I never do, I basically put my test files under 'application/controllers/test/', and run them all from the command line).
Q2: I don't really have a setUp/tearDown. I think CI's unit testing class ought to provide that (not unlike how JUnit provides those methods), and I just haven't gotten around to writing my own.
Q3: Unfortunately, I don't (yet).