9 use Test::More tests => 9;
11 use Catalyst::Test 'TestCGIBin';
12 use HTTP::Request::Common;
14 # this should be ignored
15 $ENV{MOD_PERL} = "mod_perl/2.0";
17 my $response = request POST '/my-bin/path/test.pl', [
22 is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File');
24 $response = request '/my-bin/path/test.pl?foo=bar&bar=baz';
26 is($response->content, 'foo:bar bar:baz',
27 'Perl CGI File invoked with query params');
29 $response = request POST '/my-bin/exit.pl', [
33 is($response->content, 'hello world', 'POST to Perl CGI with exit()');
35 $response = request POST '/my-bin/exit.pl', [
40 is($response->code, 500, 'POST to Perl CGI with nonzero exit()');
42 $response = request POST '/cgihandler/dongs', [
47 is($response->content, 'foo:bar bar:baz',
48 'POST to Perl CGI File through a forward');
50 $response = request POST '/cgihandler/mtfnpy', [
55 is($response->content, 'foo:bar bar:baz',
56 'POST to Perl CGI File through a forward via cgi_action');
58 $response = request '/my-bin/path/testdata.pl';
59 is($response->content, "testing\n",
60 'scripts with __DATA__ sections work');
62 $response = request '/my-bin/pathinfo.pl/path/info';
63 is($response->content, '/path/info',
67 skip "Can't run shell scripts on non-*nix", 1
68 if $^O eq 'MSWin32' || $^O eq 'VMS';
70 is(get('/my-bin/test.sh'), "Hello!\n", 'Non-Perl CGI File');