6 use lib "$FindBin::Bin/../lib";
8 use Test::More tests => 23;
9 use Catalyst::Test 'TestApp';
11 use Catalyst::Request;
13 use HTTP::Request::Common;
19 'http://localhost/dump/request/',
20 'Content-Type' => 'text/plain',
21 'Content' => 'Hello Catalyst'
24 ok( my $response = request($request), 'Request' );
25 ok( $response->is_success, 'Response Successful 2xx' );
26 is( $response->content_type, 'text/plain', 'Response Content-Type' );
27 like( $response->content, qr/'Catalyst::Request'/,
28 'Content is a serialized Catalyst::Request' );
33 eval '$creq = ' . $response->content,
34 'Unserialize Catalyst::Request'
38 isa_ok( $creq, 'Catalyst::Request' );
39 is( $creq->method, 'POST', 'Catalyst::Request method' );
40 is( $creq->content_type, 'text/plain', 'Catalyst::Request Content-Type' );
41 is( $creq->{__body_type}, 'File::Temp' );
42 is( $creq->content_length, $request->content_length,
43 'Catalyst::Request Content-Length' );
50 'http://localhost/dump/request/',
51 'Content-Type' => 'text/plain',
52 'Content' => 'x' x 100_000
55 ok( my $response = request($request), 'Request' );
56 ok( $response->is_success, 'Response Successful 2xx' );
57 is( $response->content_type, 'text/plain', 'Response Content-Type' );
60 qr/^bless\( .* 'Catalyst::Request' \)$/s,
61 'Content is a serialized Catalyst::Request'
67 eval '$creq = ' . $response->content,
68 'Unserialize Catalyst::Request'
72 isa_ok( $creq, 'Catalyst::Request' );
73 is( $creq->method, 'POST', 'Catalyst::Request method' );
74 is( $creq->content_type, 'text/plain', 'Catalyst::Request Content-Type' );
75 is( $creq->{__body_type}, 'File::Temp' );
76 is( $creq->content_length, $request->content_length,
77 'Catalyst::Request Content-Length' );
80 # 5.80 regression, see note in Catalyst::Plugin::Test::Plugin
83 'http://localhost/dump/response',
84 'Content-Type' => 'text/plain',
85 'Content' => 'x' x 100_000
88 ok( my $response = request($request), 'Request' );
89 ok( $response->is_success, 'Response Successful 2xx' );
90 ok( $response->header('X-Have-Request-Body'), 'X-Have-Request-Body set' );