allow overriding of public cgi-bin paths
[catagits/Catalyst-Controller-WrapCGI.git] / t / cgibin.t
CommitLineData
21a20b7e 1#!perl
2
3use strict;
4use warnings;
5
6use FindBin '$Bin';
7use lib "$Bin/lib";
8
9use Test::More tests => 4;
10
11use Catalyst::Test 'TestCGIBin';
12use HTTP::Request::Common;
13
46a4350c 14# this should be ignored
15$ENV{MOD_PERL} = "mod_perl/2.0";
16
9cc2dd4c 17my $response = request POST '/my-bin/path/test.pl', [
21a20b7e 18 foo => 'bar',
19 bar => 'baz'
20];
21
22is($response->content, 'foo:bar bar:baz', 'POST to Perl CGI File');
23
24$response = request POST '/cgihandler/dongs', [
25 foo => 'bar',
26 bar => 'baz'
27];
28
29is($response->content, 'foo:bar bar:baz',
30 'POST to Perl CGI File through a forward');
31
32$response = request POST '/cgihandler/mtfnpy', [
33 foo => 'bar',
34 bar => 'baz'
35];
36
37is($response->content, 'foo:bar bar:baz',
38 'POST to Perl CGI File through a forward via cgi_action');
39
40SKIP: {
41 skip "Can't run shell scripts on non-*nix", 1
42 if $^O eq 'MSWin32' || $^O eq 'VMS';
43
9cc2dd4c 44 is(get('/my-bin/test.sh'), "Hello!\n", 'Non-Perl CGI File');
21a20b7e 45}