perl - Mocking up Apache session data for unit testing -


i'm working web application that, normally, runs in mod_perl under apache. co-worker , trying unit testing. there tools or techniques out there mocking-up sessions , requests , exercise code outside of web server context?

if you're using mod_perl 1, there apache::fakerequest comes mod_perl. not complete mock of request object, have add methods of own. more if code uses apache::request. yet more cookies , uploads. you're going spending lot of time test::mockobject. fortunately, apache object interfaces pretty straight forward.

if @ possible, should consider switching plack based framework (catalyst, dancer, etc...) provide far more robust testing , debugging facilities. if you're using mod_perl2, you're in luck! it's easy (relative mod_perl 1) wrap mod_perl2 application plack. plack::app::fakeapache of work you. here discussion sketching out various techniques , benefits.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -