So I went forward and made my own Unit Testing Class.
Currently, it has assert() and run() as functions.
You make a class then, that extends my Unit Testing class (somewhat like simpletest). Then, you have your methods there, that use assert($test, $expected, $name); to check if the expected result is the one I want. It runs on ===, so the expected result must be exactly the same as the expected result. Otherwise, expecting true and getting 'Oops. I'm a string' would be considered as a passed test. And that, I don't want.
The run() method simply looks for all the functions in the class and runs them. Whenever assert() is called, it adds up to the list of run tests, as well as working and non working tests. When a test fails, it also tells me the given result, and the expected result.
Then, it packs everything up and puts it in a nice looking (similar to Simpletest) template, with everything organized for me.
So, I'm wondering, what do you think of my (small) solution? It makes my testing a hell lot easier
This has worked perfectly for me, as I was able to create several real life situations with fake data. Also, because I have a strict policy for my models (they receive their input from arguments and arguments only, no direct access to globals is permitted), my tester always works. If I had to created fake $_POST or fake $_GET, it would be much more annoying.
And I have a global test runner that runs ALL the tests, after I change stuff, and it sees if EVERYTHING is working perfectly. It's so much better than changing stuff, and then going to each page and testing out manually (which is actually harder, when you start dealing with stuff that is time consuming or just plain old boring, like filling out a form several times to test if filtering / validation solutions are working [Don't attempt that at home
And as I make functions on the project, I make unit tests for them. And as the website grows, all the tests grow. So in the future, if I ever change anything, I'll just run a whole test and if anything goes red, I'll know that, and will fix it.
Chris Corbyn said that I would only understand it when I got the feeling of it. Now I know what he meant.
Come to think of it,
Comments, anyone?
UPDATE: My reports are now somewhat different from Simpletest's. It shows a normal x/x test cases completed, x passed, x failed (I don't have exceptions, my tool is not that complex