libtest-cgi-multipart-perl

Support for testing posting of multi-part form data
  http://search.cpan.org/dist/Test-CGI-Multipart/
  0
  no reviews



It is quite difficult to write test code to capture the behaviour of cgi or similar objects handling forms that include a file upload. such code needs to harvest the parameters, build file content in mime format, set the environment variables accordingly and pump it into the the standard input of the required cgi object. this module provides simple methods so that having prepared suitable content, the test script can simulate the submission of web forms including file uploads.

moreover a test script is not always the best place to prepare content. rather a test script would rather specify requirements for a file a upload: type, size, mismatches between the file name and its contents and so on. this module cannot hope to provide such open ended functionality but it can provide extension mechanisms.

test::cgi::multipart works with cgi (the default), cgi::minimal and cgi::simple. in principle it ought to work with all equivalent modules however each module has a slightly different interface when it comes to file uploads and so requires slightly different test code.