9 use Test::More tests => 7;
11 use Catalyst::Test 'TestApp';
12 use HTTP::Request::Common;
14 my $response = request POST '/cgi-bin/test.cgi', [
19 is($response->content, 'foo:bar bar:baz', 'POST to CGI');
21 $response = request POST '/cgi-bin/test.cgi', [
24 ], User_Agent => 'perl/5', Content_Type => 'form-data';
26 is($response->content, 'foo:bar bar:baz', 'POST to CGI (form-data)');
28 $response = request POST '/cgi-bin/test.cgi',
35 'Some-Header' => 'blah',
36 'Content-Type' => 'text/plain',
39 quux => [ undef, quux => Content => 4 ],
41 User_Agent => 'perl/5',
42 Content_Type => 'form-data';
44 is($response->content, 'foo:1 bar:2 baz:3 quux:4', 'POST with file upload');
46 $response = request '/cgi-bin/test_pathinfo.cgi/path/%2Finfo';
47 is($response->content, '/path//info', 'PATH_INFO is correct');
49 $response = request '/cgi-bin/test_filepathinfo.cgi/path/%2Finfo';
50 is($response->content, '/test_filepath_info/path/%2Finfo',
51 'FILEPATH_INFO is correct (maybe)');
53 $response = request '/cgi-bin/mtfnpy/test_scriptname.cgi/foo/bar';
54 is($response->content, '/cgi-bin/mtfnpy/test_scriptname.cgi',
55 'SCRIPT_NAME is correct');
60 skip 'no $c->req->remote_user', 1
61 if $Catalyst::VERSION < 5.80005;
63 $ENV{REMOTE_USER} = 'TEST_USER';
64 $response = request '/cgi-bin/test_remote_user.cgi';
65 is($response->content, 'TEST_USER', 'REMOTE_USER was passed');