At 8:30 AM +1300 12/12/03, Nick Phillips wrote:
Just wondering whether anyone here has any cunning ways of unit testing code
that uses the various Apache:: modules; the only vaguely useful thing I've
managed to find so far is Apache::FakeRequest, but that still leaves problems
with code that uses Apache::Request, Apache::Cookie etc.

Surely *someone* has done it before?...

On a related note, I've been wondering if its even necessary to unit test web applications. At least the display part. You'd essentially be testing if the data you put into the page actually got there. Or that it got saved correctly to the database/file/etc. Sounds suspiciously like testing getters and setters to me.


Does anyone 'screen scrape' their output HTML to test their code? I would think it would be much easier/effective to just test the data before its passed to tt2 or your templating system of choice. Or maybe for testing just set up templates to dump the raw variables passed in as a perl data structure, and have your test suite read those from the web page and check for the correct values.

Effectively testing web apps without messing around with parsing HTML is something I've been wondering about for a while. Anyone solve this problem well?

-Andrew



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to