fix objects that evaulate to false. rafl
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / Forward.pm
CommitLineData
dd4e6fd2 1package TestApp::Controller::Action::Forward;
2
3use strict;
4use base 'TestApp::Controller::Action';
5
a1dad9c1 6sub one : Local {
dd4e6fd2 7 my ( $self, $c ) = @_;
8 $c->forward('two');
9}
10
11sub two : Private {
12 my ( $self, $c ) = @_;
13 $c->forward('three');
14}
15
a1dad9c1 16sub three : Local {
dd4e6fd2 17 my ( $self, $c ) = @_;
18 $c->forward('four');
19}
20
21sub four : Private {
22 my ( $self, $c ) = @_;
7eb331e7 23 $c->forward('/action/forward/five');
dd4e6fd2 24}
25
a1dad9c1 26sub five : Local {
dd4e6fd2 27 my ( $self, $c ) = @_;
28 $c->forward('TestApp::View::Dump::Request');
29}
30
a1c8f974 31sub six : Local {
32 my ( $self, $c ) = @_;
33 $c->forward('TestApp::View::Dump::False');
34}
35
7eb331e7 36
a1dad9c1 37sub jojo : Local {
dd4e6fd2 38 my ( $self, $c ) = @_;
39 $c->forward('one');
40 $c->forward('three');
41}
42
c462faf0 43
a1dad9c1 44sub inheritance : Local {
c462faf0 45 my ( $self, $c ) = @_;
5b387dfc 46 $c->forward('/action/inheritance/a/b/default');
c462faf0 47 $c->forward('five');
48}
49
a1dad9c1 50sub global : Local {
e5d7f18c 51 my ( $self, $c ) = @_;
a1dad9c1 52 $c->forward( '/global_action' );
e5d7f18c 53}
54
a1dad9c1 55sub with_args : Local {
56 my ( $self, $c, $orig ) = @_;
57 $c->forward( 'args',[qq/new/] );
58 $c->res->body( $c->req->args->[0] );
59}
60
61sub with_method_and_args : Local {
62 my ( $self, $c, $orig ) = @_;
63 $c->forward( qw/TestApp::Controller::Action::Forward args/, [qq/new/] );
64 $c->res->body( $c->req->args->[0] );
65}
66
67sub args : Local {
68 my ( $self, $c, $val ) = @_;
69 die "Expected argument 'new', got '$val'" unless $val eq 'new';
70 die "passed argument does not match args" unless $val eq $c->req->args->[0];
71}
e5d7f18c 72
dd4e6fd2 731;