ChildOf Tests: chaining and dispatching on arg count
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / ChildOf.pm
CommitLineData
141459fa 1package TestApp::Controller::Action::ChildOf;
2
3use strict;
4use warnings;
5
6use base qw/Catalyst::Controller/;
7
8sub begin :Private { }
9
922c58d6 10sub foo :PathPart('childof/foo') :Captures(1) :ChildOf('/') { }
11sub foo2 :PathPart('childof/foo2') :Captures(2) :ChildOf('/') { }
141459fa 12
13sub bar :PathPart('childof/bar') :ChildOf('/') { }
14
922c58d6 15sub endpoint :PathPart('end') :ChildOf('/action/childof/foo') :Args(1) { }
16sub endpoint2 :PathPart('end2') :ChildOf('/action/childof/foo2') :Args(2) { }
141459fa 17
18sub finale :ChildOf('bar') :Args { }
19
922c58d6 20sub one :PathPart('childof/one') :ChildOf('/') :Captures(1) { }
21sub two :PathPart('two') :ChildOf('/action/childof/one') :Captures(2) { }
22
23sub three_end :PathPart('three') :ChildOf('two') :Args(3) { }
24sub one_end :PathPart('childof/one') :ChildOf('/') :Args(1) { }
25sub two_end :PathPart('two') :ChildOf('one') :Args(2) { }
26
27sub multi1 :PathPart('childof/multi') :ChildOf('/') :Args(1) { }
28sub multi2 :PathPart('childof/multi') :ChildOf('/') :Args(2) { }
29
141459fa 30sub end :Private {
31 my ($self, $c) = @_;
32 my $out = join('; ', map { join(', ', @$_) }
33 ($c->req->captures, $c->req->args));
34 $c->res->body($out);
35}
36
371;