5 use lib "$FindBin::Bin/../lib";
7 use Test::More tests => 23;
8 use Catalyst::Test 'TestApp';
10 use Catalyst::Request;
12 use HTTP::Request::Common;
18 'http://localhost/dump/request/',
19 'Content-Type' => 'text/plain',
20 'Content' => 'Hello Catalyst'
23 ok( my $response = request($request), 'Request' );
24 ok( $response->is_success, 'Response Successful 2xx' );
25 is( $response->content_type, 'text/plain', 'Response Content-Type' );
26 like( $response->content, qr/'Catalyst::Request'/,
27 'Content is a serialized Catalyst::Request' );
32 eval '$creq = ' . $response->content,
33 'Unserialize Catalyst::Request'
37 isa_ok( $creq, 'Catalyst::Request' );
38 is( $creq->method, 'POST', 'Catalyst::Request method' );
39 is( $creq->content_type, 'text/plain', 'Catalyst::Request Content-Type' );
40 is( $creq->{__body_type}, 'File::Temp' );
41 is( $creq->content_length, $request->content_length,
42 'Catalyst::Request Content-Length' );
49 'http://localhost/dump/request/',
50 'Content-Type' => 'text/plain',
51 'Content' => 'x' x 100_000
54 ok( my $response = request($request), 'Request' );
55 ok( $response->is_success, 'Response Successful 2xx' );
56 is( $response->content_type, 'text/plain', 'Response Content-Type' );
59 qr/^bless\( .* 'Catalyst::Request' \)$/s,
60 'Content is a serialized Catalyst::Request'
66 eval '$creq = ' . $response->content,
67 'Unserialize Catalyst::Request'
71 isa_ok( $creq, 'Catalyst::Request' );
72 is( $creq->method, 'POST', 'Catalyst::Request method' );
73 is( $creq->content_type, 'text/plain', 'Catalyst::Request Content-Type' );
74 is( $creq->{__body_type}, 'File::Temp' );
75 is( $creq->content_length, $request->content_length,
76 'Catalyst::Request Content-Length' );
79 # 5.80 regression, see note in Catalyst::Plugin::Test::Plugin
82 'http://localhost/dump/response',
83 'Content-Type' => 'text/plain',
84 'Content' => 'x' x 100_000
87 ok( my $response = request($request), 'Request' );
88 ok( $response->is_success, 'Response Successful 2xx' );
89 ok( $response->header('X-Have-Request-Body'), 'X-Have-Request-Body set' );