RE: Invalid file upload
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <652366DEEF97A3438EC2F4669BD66BA58A7913@msgswbmnmsp31.wellsfargo.com> |
I don't know if it will work, but try the "newUnvalidatedRequest()" method of WebForm. See http://www.agile2005.org/RP4.pdf for ideas. > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On > Behalf Of Martin Olsson > Sent: Monday, March 20, 2006 10:53 PM > To: [email protected] > Subject: [Httpunit-develop] Invalid file upload > > > Hi, > > I have a form on my webpage where the user can upload a file. > Sometimes > user write the filename (+ path) manually. Of course these filenames > (+paths) are sometimes invalid so in the .php script I check if the > uploaded file was valid or not. If it wasn't valid I print "Bad file > upload". > > I have written tests for all the forms on my webpages. For > instance it > tries to login with a username and makes sure that a "you > must specify > username" text appears and so on. > > Now, I would like to implement a similar test for the file > upload box. I > want to have httpunit manually write something like "hello" (or any > non-existent filename) and submit the form in order to assert > that the > "Bad file upload" message really appears properly. > > The problem is that the httpunit form setparameter function > only accepts > File() objects that refer to an existing file. > > How can I have HTTPUNIT submit a form with a faulty file upload? ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642