CGI-Simple
view release on metacpan or search on metacpan
t/090.14838.t view on Meta::CPAN
use Config;
use CGI::Simple;
$| = 1;
BEGIN {
if ( !$Config{d_fork} ) {
plan skip_all => "fork not available on this platform";
}
eval "use HTTP::Request::Common";
plan skip_all => "HTTP::Request::Common not available"
if $@;
plan tests => 1;
}
my $req = HTTP::Request::Common::POST(
'/dummy_location',
Content_Type => 'form-data',
Content => [ test_file => ["t/090.14838.t"], ]
);
# Useful in simulating an upload.
$ENV{REQUEST_METHOD} = 'POST';
$ENV{CONTENT_TYPE} = $req->header( 'Content-type' );
$ENV{CONTENT_LENGTH} = $req->content_length;
if ( open( CHILD, "|-" ) ) {
t/110.bad-upload.t view on Meta::CPAN
Test::More->builder->no_ending( 1 );
use Config;
use File::Spec;
use CGI::Simple;
$| = 1;
plan skip_all => "fork not available on this platform"
unless $Config{d_fork};
eval { require HTTP::Request::Common; };
plan skip_all => 'HTTP::Request::Common not available' if $@;
plan tests => 1;
my $req = HTTP::Request::Common::POST(
'/dummy_location',
Content_Type => 'form-data',
Content => [
test_file =>
[ File::Spec->catfile( split /\//, "t/test_file.txt" ) ],
]
);
# Useful in simulating an upload.
$ENV{REQUEST_METHOD} = 'POST';
( run in 0.491 second using v1.01-cache-2.11-cpan-de7293f3b23 )