elkarte/Elkarte — pull request #566 by norv (2013-06-21 08:19:29+00:00)
Title: Small additions for testing

Quick and dirty: I'd rather make these changes, in particular the flag to disable tests by default, just to avoid running them inadvertently on a database. Tests should not use directly the installed database (use their own if any) and undo what they do, so that even between tests nothing is affected. I've been using SSI for starters, which is to say it's more integration tests (of the whole application).

* I added a couple tests playing with database work functions. (the classes we have are a better choice!).
Functions working with the db aren't exactly "units", but IMHO usefulness and trying to cover our code bypasses strictness on this. Test what we can and we're up to, and leave the strictness behind on this bit. Improve them as we go. But we need to be careful _what_ we're running them on. (and leave the db in a consistent state)
* Funnily enough, I didn't even start well (I don't think this is started yet), and dropped upon a bug with createPoll(), using it with default values yields db errors.