#################################################################
# Emanuele Zeppieri, Mark Stosberg #
# Shamelessly stolen from Data::FormValidator and CGI::Upload #
#################################################################
use strict;
use CGI;
#-----------------------------------------------------------------------------
# %ENV setup.
#-----------------------------------------------------------------------------
my %myenv;
BEGIN {
%myenv = (
'HTTP_CONNECTION' => 'TE, close',
'REQUEST_METHOD' => 'POST',
'CONTENT_LENGTH' => 3285,
'SERVER_SOFTWARE' => 'Apache/1.3.27 (Unix) ',
'HTTP_TE' => 'deflate,gzip;q=0.3',
'QUERY_STRING' => '',
'REMOTE_PORT' => '1855',
'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)',
'SERVER_PORT' => '80',
'REMOTE_ADDR' => '127.0.0.1',
'SERVER_PROTOCOL' => 'HTTP/1.1',
'GATEWAY_INTERFACE' => 'CGI/1.1',
'SERVER_ADDR' => '127.0.0.1',
);
}
}
END {
}
}
#-----------------------------------------------------------------------------
# Simulate the upload (really, multiple uploads contained in a single stream).
#-----------------------------------------------------------------------------
my $q;
{
local *STDIN;
}
#-----------------------------------------------------------------------------
# Check that the file names retrieved by CGI are correct.
#-----------------------------------------------------------------------------
{
}
#-----------------------------------------------------------------------------
# Now check that the upload method works.
#-----------------------------------------------------------------------------
{
# Go to end of file;
# How long is the file?
# Go to end of file;
# How long is the file?
}
{
# Go to end of file;
# How long is the file?
}
{
"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.");
# Go to end of file;
# How long is the file?
}
{
}
# vim: nospell