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
CommitLineData
878b821c 1package TestAppOnDemand::Controller::Body;
2
3use strict;
c057ae86 4use base 'Catalyst::Controller';
878b821c 5
6use Data::Dump ();
7
cb5b55f9 8sub body_params : Local {
878b821c 9 my ( $self, $c ) = @_;
10
11 $c->res->body( Data::Dump::dump( $c->req->body_parameters ) );
12}
13
cb5b55f9 14sub query_params : Local {
15 my ( $self, $c ) = @_;
16
17 $c->res->body( Data::Dump::dump( $c->req->query_parameters ) );
18}
19
20sub params : Local {
21 my ( $self, $c ) = @_;
22
23 $c->res->body( Data::Dump::dump( $c->req->parameters ) );
24}
25
878b821c 26sub 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
c057ae86 411;