Page 1 of 1

Complicated Environments and associated testing

Posted: Mon Aug 28, 2006 9:24 pm
by Todd_Z
Using functions such as assertEqual or is_numeric are all well and good when testing individual functions, even classes, but what about testing full categories of a site, where there are $_GET vars, $_POST vars, database information, you get the idea. As I have written a custom framework, I'm looking to create unit testing tailored to my system, however how do you make sure that all 50 variables involved have appropriate values?

I know i should plead the fifth and walk away, but to be fair, I simply use the fact that certain code, for example my DB abstraction layer is used in every one of my pages to assure myself that it works... well enough :-\

It's driving me nuts that I can't prove that my code is... well... perfect. I know that's obviously an impossibility, but certain code, such as the DB abstraction layer should be absolutely flawless.

Well, thanks for listening to me rant. :?

Posted: Mon Aug 28, 2006 9:37 pm
by feyd
Two words: mock objects.