tests and patch for Controller to accept action_args from constructor
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / Action.pm
CommitLineData
734a1e11 1package TestApp::Controller::Action::Action;
2
3use strict;
4use base 'TestApp::Controller::Action';
5
d87210ec 6__PACKAGE__->config(
7 actions => {
7d81af7e 8 '*' => { extra_attribute => 13 },
9 action_action_five => { ActionClass => '+Catalyst::Action::TestBefore' },
10 action_action_eight => { another_extra_attribute => 'foo' },
d87210ec 11 },
12 action_args => {
13 '*' => { extra_arg => 42 },
14 action_action_seven => { another_extra_arg => 23 },
15 },
16);
5d8129e9 17
734a1e11 18sub action_action_one : Global : ActionClass('TestBefore') {
19 my ( $self, $c ) = @_;
20 $c->res->header( 'X-Action', $c->stash->{test} );
21 $c->forward('TestApp::View::Dump::Request');
22}
23
24sub action_action_two : Global : ActionClass('TestAfter') {
25 my ( $self, $c ) = @_;
26 $c->stash->{after_message} = 'awesome';
27 $c->forward('TestApp::View::Dump::Request');
28}
29
30sub action_action_three : Global : ActionClass('+TestApp::Action::TestBefore') {
31 my ( $self, $c ) = @_;
32 $c->forward('TestApp::View::Dump::Request');
33}
34
9287719b 35sub action_action_four : Global : MyAction('TestMyAction') {
36 my ( $self, $c ) = @_;
37 $c->forward('TestApp::View::Dump::Request');
38}
39
5d8129e9 40sub action_action_five : Global {
41 my ( $self, $c ) = @_;
42 $c->res->header( 'X-Action', $c->stash->{test} );
43 $c->forward('TestApp::View::Dump::Request');
44}
45
46sub action_action_six : Global : ActionClass('~TestMyAction') {
47 my ( $self, $c ) = @_;
48 $c->forward('TestApp::View::Dump::Request');
49}
50
d87210ec 51sub action_action_seven : Global : ActionClass('~TestExtraArgsAction') {
52 my ( $self, $c ) = @_;
53 $c->forward('TestApp::View::Dump::Request');
54}
55
7d81af7e 56sub action_action_eight : Global {
57 my ( $self, $c ) = @_;
58 $c->forward('TestApp::View::Dump::Action');
59}
60
bf7c9c87 61sub action_action_nine : Global : ActionClass('~TestActionArgsFromConstructor') {
62 my ( $self, $c ) = @_;
63 $c->forward('TestApp::View::Dump::Request');
64}
734a1e11 651;