Add tests to show that 5.80 broke ->req->parameters when you do on-demand parsing.
[catagits/Catalyst-Runtime.git] / t / lib / TestAppOnDemand / Controller / Body.pm
1 package TestAppOnDemand::Controller::Body;
2
3 use strict;
4 use base 'Catalyst::Controller';
5
6 use Data::Dump ();
7
8 sub body_params : Local {
9     my ( $self, $c ) = @_;
10
11     $c->res->body( Data::Dump::dump( $c->req->body_parameters ) );
12 }
13
14 sub query_params : Local {
15     my ( $self, $c ) = @_;
16
17     $c->res->body( Data::Dump::dump( $c->req->query_parameters ) );
18 }
19
20 sub params : Local {
21     my ( $self, $c ) = @_;
22
23     $c->res->body( Data::Dump::dump( $c->req->parameters ) );
24 }
25
26 sub read : Local {
27     my ( $self, $c ) = @_;
28     
29     # read some data
30     my @chunks;
31     
32     while ( my $data = $c->read( 10_000 ) ) {
33         push @chunks, $data;
34     }
35
36     $c->res->content_type( 'text/plain');
37     
38     $c->res->body( join ( '|', map { length $_ } @chunks ) );
39 }
40
41 1;