10 use Catalyst::Test 'TestCGIBin';
11 use HTTP::Request::Common;
13 # this should be ignored
14 $ENV{MOD_PERL} = "mod_perl/2.0";
16 my $response = request POST '/my-bin/path/test.pl', [
21 is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File');
23 $response = request '/my-bin/path/test.pl?foo=bar&bar=baz';
25 is($response->content, 'foo:bar bar:baz',
26 'Perl CGI File invoked with query params');
28 $response = request POST '/my-bin/exit.pl', [
32 is($response->content, 'hello world', 'POST to Perl CGI with exit()');
34 $response = request POST '/my-bin/exit.pl', [
39 is($response->code, 500, 'POST to Perl CGI with nonzero exit()');
41 $response = request POST '/cgihandler/mtfnpy', [
46 is($response->content, 'foo:bar bar:baz',
47 'POST to Perl CGI File through a forward via cgi_action');
49 $response = request '/my-bin/path/testdata.pl';
50 is($response->content, "testing\n",
51 'scripts with __DATA__ sections work');
53 $response = request '/my-bin/pathinfo.pl/path/info';
54 is($response->content, '/path/info',
59 ok request '/my-bin/sigs.pl';
61 is_deeply \%SIG, \%orig_sig, '%SIG is preserved';
64 skip "Can't run shell scripts on non-*nix", 1
65 if $^O eq 'MSWin32' || $^O eq 'VMS';
67 # for some reason the +x is not preserved in the dist
68 system "chmod +x $Bin/lib/TestCGIBin/root/cgi-bin/test.sh";
70 is(get('/my-bin/test.sh'), "Hello!\n", 'Non-Perl CGI File');