2N/A################################################################# 2N/A# Emanuele Zeppieri, Mark Stosberg # 2N/A# Shamelessly stolen from Data::FormValidator and CGI::Upload # 2N/A################################################################# 2N/A#----------------------------------------------------------------------------- 2N/A#----------------------------------------------------------------------------- 2N/A 'HTTP_CONNECTION' => 'TE, close', 2N/A 'REQUEST_METHOD' => 'POST', 2N/A 'CONTENT_LENGTH' => 3285, 2N/A 'SERVER_SOFTWARE' => 'Apache/1.3.27 (Unix) ', 2N/A 'HTTP_TE' => 'deflate,gzip;q=0.3', 2N/A 'QUERY_STRING' => '', 2N/A 'REMOTE_PORT' => '1855', 2N/A 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)', 2N/A 'SERVER_PORT' => '80', 2N/A 'REMOTE_ADDR' => '127.0.0.1', 2N/A 'SERVER_PROTOCOL' => 'HTTP/1.1', 2N/A 'GATEWAY_INTERFACE' => 'CGI/1.1', 2N/A 'SERVER_ADDR' => '127.0.0.1', 2N/A#----------------------------------------------------------------------------- 2N/A# Simulate the upload (really, multiple uploads contained in a single stream). 2N/A#----------------------------------------------------------------------------- 2N/A#----------------------------------------------------------------------------- 2N/A# Check that the file names retrieved by CGI are correct. 2N/A#----------------------------------------------------------------------------- 2N/A my $test = "multiple file names are handled right with same-named upload fields"; #----------------------------------------------------------------------------- # Now check that the upload method works. #----------------------------------------------------------------------------- my $test = "file handles have expected length for multi-valued field. "; my $test = "300x300_gif has expected length"; is(tell($fh1), 0, "First object: filehandle starts with position set at zero"); my $test = "Upload filehandles still work after calling CGI->new a second time"; "Reality Check: params set in one object instance don't appear in another instance"); is(tell($fh2), 0, "...so the state of a file handle shouldn't be carried to a new object instance, either."); my $test = "multi-valued uploads are reset properly";