Really. I did read that
all_tests.php (https://github.com/norv/elkarte/blob/d6041b5f63ef22c7769fd34480c440a540c52619/tests/all_tests.php#L20) collects all tests files, and running it will do all the rest: load the classes, execute all the testSomething() methods it finds in each of them in order, and print out the results.
(start-up PR https://github.com/elkarte/Elkarte/pull/527)
Or, all_tests.php can be run in the browser, in which case it looks all nice and green. For now, 'cuz I cheated and added only very basic tests.
SimpleTest covers a lot of automated testing, not only pure function/method tests. The very nice thing with it is, it also gives the possibility to write web UI tests: to follow links, submit forms, and check the HTTP responses, in a very simple way. To use the web tester, testcases extend WebTestCase instead:
class TestMyPage extends WebTestCase
{
function testStuffButton()
{
$this->get('http://localhostish_elk/index.php');
$this->click('Stuff');
$this->assertTitle('Awesome stuff.');
}
}
With even only the links we have as a guest (without counting yet forms submissions), we can make simple tests for each, to be sure that when Ema we write some code, the responses are still what we expect, and there'll be no fatal error somewhere or not cool stuff like that.
You may want to check out SimpleTest's hands-on documentation: http://www.simpletest.org/en/start-testing.html
There's a long time I wanted to cover this software with unit testing. The huge advantage is, the more specific cases we have covered, the most likely it is to receive immediate feedback from the tests. For a commit or PR, we can try to write some test(s) for the changes made. And, of course, run all the suite to make sure it doesn't break something else.
One more note I'd make: we can also write tests before implementing a feature or refactoring. It can play the role of a specification of behavior. Those are the most fun. ;)