[Catalyst-commits] r13639 - in Catalyst-Engine-Apache/trunk/t: .
lib lib/ACLTestApp lib/ACLTestApp/Controller lib/Catalyst
lib/Catalyst/Action lib/Catalyst/Plugin
lib/Catalyst/Plugin/Test lib/Catalyst/Script
lib/ChainedActionsApp lib/ChainedActionsApp/Controller
lib/DeprecatedTestApp lib/DeprecatedTestApp/C
lib/PluginTestApp lib/PluginTestApp/Controller
lib/ScriptTestApp lib/ScriptTestApp/Script lib/TestApp
lib/TestApp/Action lib/TestApp/Controller
lib/TestApp/Controller/Action lib/TestApp/Controller/Action/Auto
lib/TestApp/Controller/Action/Chained
lib/TestApp/Controller/Action/Chained/Auto
lib/TestApp/Controller/Action/Chained/ParentChain
lib/TestApp/Controller/Engine lib/TestApp/Controller/Engine/Request
lib/TestApp/Controller/Engine/Response
lib/TestApp/Controller/Immutable lib/TestApp/Controller/Moose
lib/TestApp/Controller/Priorities lib/TestApp/DispatchType
lib/TestApp/Model lib/TestApp/Model/Foo lib/TestApp/Plugin
lib/TestApp/View lib/TestApp/View/Dump
lib/TestAppChainedAbsolutePathPart
lib/TestAppChainedAbsolutePathPart/Controller
lib/TestAppChainedRecursive lib/TestAppChainedRecursive/Controller
lib/TestAppDoubleAutoBug lib/TestAppDoubleAutoBug/Controller
lib/TestAppEncoding lib/TestAppEncoding/Controller
lib/TestAppIndexDefault lib/TestAppIndexDefault/Controller
lib/TestAppMatchSingleArg
lib/TestAppMatchSingleArg/Controller lib/TestAppMetaCompat
lib/TestAppMetaCompat/Controller lib/TestAppNonMooseController
lib/TestAppNonMooseController/Controller lib/TestAppOnDemand
lib/TestAppOnDemand/Controller lib/TestAppOneView
lib/TestAppOneView/Controller lib/TestAppOneView/View
lib/TestAppPluginWithConstructor
lib/TestAppPluginWithConstructor/Controller
lib/TestAppShowInternalActions
lib/TestAppShowInternalActions/Controller lib/TestAppStats
lib/TestAppStats/Controller lib/TestAppViewWarnings
lib/TestAppViewWarnings/Controller lib/TestAppWithMeta
lib/TestAppWithMeta/Controller
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Mon Oct 4 19:17:09 GMT 2010
Author: t0m
Date: 2010-10-04 20:17:09 +0100 (Mon, 04 Oct 2010)
New Revision: 13639
Added:
Catalyst-Engine-Apache/trunk/t/lib/
Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp.pm
Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp/
Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp/Controller/
Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/CDICompatTestPlugin.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/TestAfter.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/TestBefore.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Deprecated.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Errors.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Headers.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/MangleDollarUnderScore.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/Bar.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/Baz.pm
Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/CompileTest.pm
Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp.pm
Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp/
Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp/Controller/
Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/DeprecatedActionsInAppClassTestApp.pm
Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp.pm
Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp/
Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp/C/
Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp/C/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/NullPackage.pm
Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp.pm
Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp/
Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp/Controller/
Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/
Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/
Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/Bar.pm
Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/CompileTest.pm
Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/Foo.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestBefore.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestExtraArgsAction.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestMyAction.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Action.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Abort.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Deep.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Default.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Begin.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ArgsOrder.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Bar.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Detach.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Foo.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Forward.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Bar.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Foo.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain/Relative.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/PassedArgs.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/PathPrefix.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Default.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Detach.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/End.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Forward.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/ForwardTo.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Global.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Go.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Index.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Inheritance.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Local.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Path.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Private.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Regexp.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Streaming.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/TestMultipath.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/TestRelative.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Visit.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Anon.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Args.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Attributes.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/ContextClosure.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Dump.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/URI.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/Uploads.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Cookies.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Errors.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Headers.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Large.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Print.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Redirect.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Status.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Fork.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable/HardToReload.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Index.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Keyword.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/MethodModifiers.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/NoAttributes.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/MultiMethod.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/loc_vs_index.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/locre_vs_index.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/path_vs_index.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/re_vs_index.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/CustomPostLoad.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/CustomPreLoad.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/ClosuresInConfig.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo/Bar.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Generating.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/AddDispatchTypes.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/FullyQualified.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/ParameterizedRole.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/RequestBaseBug.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/Role.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/
Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Body.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Env.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Request.pm
Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Response.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppBadlyImmutable.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart/
Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart/Controller/Foo.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive/
Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive/Controller/Foo.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppClassExceptionSimpleTest.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug/
Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding/
Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/
Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/Default.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/IndexChained.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/IndexPrivate.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg/
Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/
Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/Base.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/Books.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/
Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/Controller/Foo.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/ControllerBase.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand/
Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand/Controller/Body.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/
Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/View/
Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/View/Dummy.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppPathBug.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor/
Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions/
Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppStats.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppStats/
Catalyst-Engine-Apache/trunk/t/lib/TestAppStats/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppStats/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppToTestScripts.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppUnknownError.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings/
Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta.pm
Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta/
Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta/Controller/
Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta/Controller/Root.pm
Catalyst-Engine-Apache/trunk/t/lib/TestPluginWithConstructor.pm
Log:
Replace the external with a copy. I think a load of this stuff can be trimmed
Added: Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,18 @@
+package ACLTestApp::Controller::Root;
+use Test::More;
+
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub foobar : Private {
+ die $Catalyst::DETACH;
+}
+
+sub gorch : Local {
+ my ( $self, $c, $frozjob ) = @_;
+ is $frozjob, 'wozzle';
+ $c->res->body("gorch");
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/ACLTestApp.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,26 @@
+package ACLTestApp;
+use Test::More;
+
+use strict;
+use warnings;
+use MRO::Compat;
+use Scalar::Util ();
+
+use base qw/Catalyst Catalyst::Controller/;
+use Catalyst qw//;
+
+sub execute {
+ my $c = shift;
+ my ( $class, $action ) = @_;
+
+ if ( Scalar::Util::blessed($action)
+ and $action->name ne "foobar" ) {
+ eval { $c->detach( 'foobar', [$action, 'foo'] ) };
+ }
+
+ $c->next::method( @_ );
+}
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/CDICompatTestPlugin.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/CDICompatTestPlugin.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/CDICompatTestPlugin.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,42 @@
+package CDICompatTestPlugin;
+
+# This plugin specificially tests an edge case of C::D::I compat,
+# where you load a plugin which creates an accessor with the same
+# name as a class data accessor (_config in this case)..
+
+# This is what happens if you use the authentication back-compat
+# stuff, as C::A::Plugin::Credential::Password is added to the plugin
+# list, and that uses base C::A::C::P class, does the mk_accessors.
+
+# If a class data method called _config hasn't been created in
+# MyApp ($app below), then our call to ->config gets our accessor
+# (rather than the class data one), and we fail..
+
+use strict;
+use warnings;
+use base qw/Class::Accessor::Fast/;
+use MRO::Compat;
+__PACKAGE__->mk_accessors(qw/_config/);
+
+sub setup {
+ my $app = shift;
+
+ $app->config;
+ $app->next::method(@_);
+}
+
+# However, if we are too enthusiastic about adding accessors to the
+# MyApp package, then this method isn't called (as there is a local
+# symbol already).
+
+# Note - use a different package here, so that Moose's
+# package detection code doesn't get confused..
+$CDICompatTestPlugin::Data::HAS_RUN_SETUP_FINISHED = 0;
+
+sub setup_finished {
+ my $app = shift;
+ $CDICompatTestPlugin::Data::HAS_RUN_SETUP_FINISHED = 1;
+ $app->next::method(@_);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/TestAfter.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/TestAfter.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/TestAfter.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,15 @@
+package Catalyst::Action::TestAfter;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Action/;
+
+sub execute {
+ my $self = shift;
+ my ( $controller, $c ) = @_;
+ $self->next::method( @_ );
+ $c->res->header( 'X-Action-After', $c->stash->{after_message} );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/TestBefore.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/TestBefore.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Action/TestBefore.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,15 @@
+package Catalyst::Action::TestBefore;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Action/;
+
+sub execute {
+ my $self = shift;
+ my ( $controller, $c ) = @_;
+ $c->stash->{test} = 'works';
+ $self->next::method( @_ );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Deprecated.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Deprecated.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Deprecated.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,17 @@
+package Catalyst::Plugin::Test::Deprecated;
+
+use strict;
+use warnings;
+
+sub prepare {
+ my $class = shift;
+ # Note: This use of NEXT is deliberately left here (without a use NEXT)
+ # to ensure back compat, as NEXT always used to be loaded, but
+ # is now replaced by Class::C3::Adopt::NEXT.
+ my $c = $class->NEXT::prepare(@_);
+ $c->response->header( 'X-Catalyst-Plugin-Deprecated' => 1 );
+
+ return $c;
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Errors.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Errors.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Errors.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,33 @@
+package Catalyst::Plugin::Test::Errors;
+
+use strict;
+use MRO::Compat;
+
+sub error {
+ my $c = shift;
+
+ unless ( $_[0] ) {
+ return $c->next::method(@_);
+ }
+
+ if ( $_[0] =~ /^(Unknown resource|No default action defined)/ ) {
+ $c->response->status(404);
+ }
+
+ if ( $_[0] =~ /^Couldn\'t forward/ ) {
+ $c->response->status(404);
+ }
+
+ if ( $_[0] =~ /^Caught exception/ ) {
+ $c->response->status(500);
+ }
+
+ my $error = $_[0];
+ $error =~ s/\n/, /g;
+
+ $c->response->headers->push_header( 'X-Catalyst-Error' => $error );
+
+ $c->next::method(@_);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Headers.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Headers.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Headers.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,34 @@
+package Catalyst::Plugin::Test::Headers;
+
+use strict;
+use MRO::Compat;
+
+sub prepare {
+ my $class = shift;
+
+ my $c = $class->next::method(@_);
+
+ $c->response->header( 'X-Catalyst-Engine' => $c->engine );
+ $c->response->header( 'X-Catalyst-Debug' => $c->debug ? 1 : 0 );
+
+ {
+ my $components = join( ', ', sort keys %{ $c->components } );
+ $c->response->header( 'X-Catalyst-Components' => $components );
+ }
+
+ {
+ no strict 'refs';
+ my $plugins = join ', ', $class->registered_plugins;
+ $c->response->header( 'X-Catalyst-Plugins' => $plugins );
+ }
+
+ return $c;
+}
+
+sub prepare_action {
+ my $c = shift;
+ $c->next::method(@_);
+ $c->res->header( 'X-Catalyst-Action' => $c->req->action );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/MangleDollarUnderScore.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/MangleDollarUnderScore.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/MangleDollarUnderScore.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package Catalyst::Plugin::Test::MangleDollarUnderScore;
+use strict;
+use warnings;
+
+our $VERSION = 0.1; # Make is_class_loaded happy
+
+# Class::MOP::load_class($_) can hurt you real hard.
+BEGIN { $_ = q{
+mst sayeth, Class::MOP::load_class($_) will ruin your life
+rafl spokeh "i ♥ my $_"',
+and verrily forsooth, t0m made tests
+and yea, there was fail' }; }
+
+1;
+__END__
+
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,35 @@
+package Catalyst::Plugin::Test::Plugin;
+
+use strict;
+use warnings;
+use MRO::Compat;
+
+use base qw/Class::Data::Inheritable/;
+
+ __PACKAGE__->mk_classdata('ran_setup');
+
+sub setup {
+ my $c = shift;
+ $c->ran_setup('1');
+}
+
+sub prepare {
+ my $class = shift;
+
+ my $c = $class->next::method(@_);
+ $c->response->header( 'X-Catalyst-Plugin-Setup' => $c->ran_setup );
+
+ return $c;
+}
+
+# Note: Catalyst::Plugin::Server forces the body to
+# be parsed, by calling the $c->req->body method in prepare_action.
+# We need to test this, as this was broken by 5.80. See also
+# t/aggregate/live_engine_request_body.t.
+sub prepare_action {
+ my $c = shift;
+ $c->res->header('X-Have-Request-Body', 1) if $c->req->body;
+ $c->next::method(@_);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/Bar.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/Bar.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/Bar.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,9 @@
+package Catalyst::Script::Bar;
+use Moose;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/Baz.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/Baz.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/Baz.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package Catalyst::Script::Baz;
+use Moose;
+use namespace::autoclean;
+
+use Test::More;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+after new_with_options => sub {
+ my ($self, %args) = @_;
+ is_deeply \%args, { application_name => 'ScriptTestApp' }, 'App name correct';
+};
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/CompileTest.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/CompileTest.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/Catalyst/Script/CompileTest.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package Catalyst::Script::CompileTest;
+use Moose;
+use namespace::autoclean;
+
+use Test::More;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+after new_with_options => sub {
+ my ($self, %args) = @_;
+ is_deeply \%args, { application_name => 'ScriptTestApp' }, 'App name correct';
+};
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,63 @@
+package ChainedActionsApp::Controller::Root;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller' }
+
+#
+# Sets the actions in this controller to be registered with no prefix
+# so they function identically to actions created in MyApp.pm
+#
+__PACKAGE__->config(namespace => '');
+
+sub setup : Chained('/') PathPart('') CaptureArgs(0) {
+ my ( $self, $c ) = @_;
+ # Common things here are to check for ACL and setup global contexts
+}
+
+sub home : Chained('setup') PathPart('') Args(0) {
+ my($self,$c) = @_;
+ $c->response->body( "Application Home Page" );
+}
+
+sub home_base : Chained('setup') PathPart('') CaptureArgs(2) {
+ my($self,$c,$proj_id,$title) = @_;
+ $c->stash({project_id=>$proj_id, project_title=>$title});
+}
+
+sub hpages : Chained('home_base') PathPart('') Args(0) {
+ my($self,$c) = @_;
+ $c->response->body( "List project " . $c->stash->{project_title} . " pages");
+}
+
+sub hpage : Chained('home_base') PathPart('') Args(2) {
+ my($self,$c,$page_id, $pagetitle) = @_;
+ $c->response->body( "This is $pagetitle page of " . $c->stash->{project_title} . " project" );
+}
+
+sub no_account : Chained('setup') PathPart('account') Args(0) {
+ my($self,$c) = @_;
+ $c->response->body( "New account o login" );
+}
+
+sub account_base : Chained('setup') PathPart('account') CaptureArgs(1) {
+ my($self,$c,$acc_id) = @_;
+ $c->stash({account_id=>$acc_id});
+}
+
+sub account : Chained('account_base') PathPart('') Args(0) {
+ my($self,$c,$acc) = @_;
+ $c->response->body( "This is account " . $c->stash->{account_id} );
+}
+
+sub default : Chained('setup') PathPart('') Args() {
+ my ( $self, $c ) = @_;
+ $c->response->body( 'Page not found' );
+ $c->response->status(404);
+}
+
+sub end : Action {}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/ChainedActionsApp.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,21 @@
+package ChainedActionsApp;
+use Moose;
+use namespace::autoclean;
+
+use Catalyst::Runtime 5.80;
+
+use Catalyst qw//;
+
+extends 'Catalyst';
+
+our $VERSION = "0.01";
+$VERSION = eval $VERSION;
+
+__PACKAGE__->config(
+ name => 'ChainedActionsApp',
+ disable_component_regex_fallback => 1,
+);
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/DeprecatedActionsInAppClassTestApp.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/DeprecatedActionsInAppClassTestApp.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/DeprecatedActionsInAppClassTestApp.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,30 @@
+package DeprecatedActionsInAppClassTestApp;
+
+use strict;
+use warnings;
+use Catalyst;
+
+our $VERSION = '0.01';
+
+__PACKAGE__->config( name => 'DeprecatedActionsInAppClassTestApp', root => '/some/dir' );
+__PACKAGE__->log(DeprecatedActionsInAppClassTestApp::Log->new);
+__PACKAGE__->setup;
+
+sub foo : Local {
+ my ($self, $c) = @_;
+ $c->res->body('OK');
+}
+
+package DeprecatedActionsInAppClassTestApp::Log;
+use strict;
+use warnings;
+use base qw/Catalyst::Log/;
+
+our $warnings;
+
+sub warn {
+ my ($self, $warning) = @_;
+ $warnings++ if $warning =~ /action methods .+ found defined/i;
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp/C/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp/C/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp/C/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,18 @@
+package DeprecatedTestApp::C::Root;
+use strict;
+use warnings;
+use base qw/Catalyst::Controller/;
+
+__PACKAGE__->config->{namespace} = '';
+
+sub index : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body('root index');
+}
+
+sub req_user : Local {
+ my ( $self, $c ) = @_;
+ $c->res->body('REMOTE_USER = ' . $c->req->user);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/DeprecatedTestApp.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,14 @@
+package DeprecatedTestApp;
+
+use strict;
+use Catalyst qw/
+ Test::Deprecated
+/;
+
+our $VERSION = '0.01';
+
+__PACKAGE__->config( name => 'DeprecatedTestApp', root => '/some/dir' );
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/NullPackage.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/NullPackage.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/NullPackage.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,7 @@
+package NullPackage;
+# Do nothing class, there should be no code or symbols defined here..
+# Loading this works fine in 5.70, but a die was introduced in 5.80 which caused
+# it to fail. This has been changed to a warning to maintain back-compat.
+# See Catalyst::Utils::ensure_class_loaded() for more info.
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,62 @@
+package PluginTestApp::Controller::Root;
+use Test::More;
+
+use base 'Catalyst::Controller';
+
+#use Catalyst qw(
+# Test::Plugin
+# +TestApp::Plugin::FullyQualified
+# );
+
+__PACKAGE__->config->{namespace} = '';
+
+sub compile_time_plugins : Local {
+ my ( $self, $c ) = @_;
+
+ isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
+ isa_ok $c, 'TestApp::Plugin::FullyQualified';
+
+ can_ok $c, 'registered_plugins';
+ $c->_test_plugins;
+
+ $c->res->body("ok");
+}
+
+sub run_time_plugins : Local {
+ my ( $self, $c ) = @_;
+
+ $c->_test_plugins;
+ my $faux_plugin = 'Faux::Plugin';
+
+# Trick perl into thinking the plugin is already loaded
+ $INC{'Faux/Plugin.pm'} = 1;
+
+ ref($c)->plugin( faux => $faux_plugin );
+
+ isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
+
+ # applied parameterized role
+ if (eval { require MooseX::Role::Parameterized; 1 }) {
+ can_ok $c, 'affe';
+ is $c->affe, 'birne', 'right method created by parameterized role';
+ }
+
+ isa_ok $c, 'TestApp::Plugin::FullyQualified';
+ ok !$c->isa($faux_plugin),
+ '... and it should not inherit from the instant plugin';
+ can_ok $c, 'faux';
+ is $c->faux->count, 1, '... and it should behave correctly';
+ is_deeply [ $c->registered_plugins ],
+ [
+ qw/Catalyst::Plugin::Test::Plugin
+ Faux::Plugin
+ TestApp::Plugin::FullyQualified/
+ ],
+ 'registered_plugins() should report all plugins';
+ ok $c->registered_plugins('Faux::Plugin'),
+ '... and even the specific instant plugin';
+
+ $c->res->body("ok");
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/PluginTestApp.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,28 @@
+package PluginTestApp;
+use Test::More;
+
+use Catalyst (
+ 'Test::Plugin',
+ '+TestApp::Plugin::FullyQualified',
+ (eval { require MooseX::Role::Parameterized; 1 }
+ ? ('+TestApp::Plugin::ParameterizedRole' => { method_name => 'affe' })
+ : ()),
+);
+
+sub _test_plugins {
+ my $c = shift;
+ is_deeply [ $c->registered_plugins ],
+ [
+ qw/Catalyst::Plugin::Test::Plugin
+ TestApp::Plugin::FullyQualified/
+ ],
+ '... and it should report the correct plugins';
+ ok $c->registered_plugins('Catalyst::Plugin::Test::Plugin'),
+ '... or if we have a particular plugin';
+ ok $c->registered_plugins('Test::Plugin'),
+ '... even if it is not fully qualified';
+ ok !$c->registered_plugins('No::Such::Plugin'),
+ '... and it should return false if the plugin does not exist';
+}
+
+__PACKAGE__->setup;
Added: Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/Bar.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/Bar.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/Bar.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,9 @@
+package ScriptTestApp::Script::Bar;
+use Moose;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/CompileTest.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/CompileTest.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/CompileTest.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,7 @@
+package ScriptTestApp::Script::CompileTest;
+use Moose;
+use namespace::autoclean;
+
+die("Does not compile");
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/Foo.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/Foo.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/ScriptTestApp/Script/Foo.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,9 @@
+package ScriptTestApp::Script::Foo;
+use Moose;
+use namespace::autoclean;
+
+with 'Catalyst::ScriptRole';
+
+sub run { __PACKAGE__ }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestBefore.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestBefore.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestBefore.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,15 @@
+package TestApp::Action::TestBefore;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Action/;
+
+sub execute {
+ my $self = shift;
+ my ( $controller, $c, $test ) = @_;
+ $c->res->header( 'X-TestAppActionTestBefore', $test );
+ $self->next::method( @_ );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestExtraArgsAction.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestExtraArgsAction.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestExtraArgsAction.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,17 @@
+package TestApp::Action::TestExtraArgsAction;
+
+use Moose;
+use namespace::autoclean;
+
+extends 'Catalyst::Action';
+
+has [qw/extra_arg another_extra_arg/] => (is => 'ro');
+
+after execute => sub {
+ my ($self, $controller, $ctx) = @_;
+ $ctx->response->header('X-TestExtraArgsAction' => join q{,} => $self->extra_arg, $self->another_extra_arg);
+};
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestMyAction.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestMyAction.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Action/TestMyAction.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,19 @@
+package TestApp::Action::TestMyAction;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Action/;
+
+sub execute {
+ my $self = shift;
+ my ( $controller, $c, $test ) = @_;
+ $c->res->header( 'X-TestAppActionTestMyAction', 'MyAction works' );
+ $c->res->header( 'X-Component-Name-Action', $controller->catalyst_component_name);
+ $c->res->header( 'X-Component-Instance-Name-Action', ref($controller));
+ $c->res->header( 'X-Class-In-Action', $self->class);
+ $self->next::method(@_);
+}
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Action.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Action.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Action.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,54 @@
+package TestApp::Controller::Action::Action;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+__PACKAGE__->config(
+ actions => {
+ action_action_five => { ActionClass => '+Catalyst::Action::TestBefore' },
+ },
+ action_args => {
+ '*' => { extra_arg => 42 },
+ action_action_seven => { another_extra_arg => 23 },
+ },
+);
+
+sub action_action_one : Global : ActionClass('TestBefore') {
+ my ( $self, $c ) = @_;
+ $c->res->header( 'X-Action', $c->stash->{test} );
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_two : Global : ActionClass('TestAfter') {
+ my ( $self, $c ) = @_;
+ $c->stash->{after_message} = 'awesome';
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_three : Global : ActionClass('+TestApp::Action::TestBefore') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_four : Global : MyAction('TestMyAction') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_five : Global {
+ my ( $self, $c ) = @_;
+ $c->res->header( 'X-Action', $c->stash->{test} );
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_six : Global : ActionClass('~TestMyAction') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_seven : Global : ActionClass('~TestExtraArgsAction') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Abort.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Abort.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Abort.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,26 @@
+package TestApp::Controller::Action::Auto::Abort;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ return 0;
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'abort default' );
+}
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'abort end' ) unless $c->res->body;
+}
+
+sub one : Local {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'abort one' );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Deep.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Deep.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Deep.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,21 @@
+package TestApp::Controller::Action::Auto::Deep;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ return 1;
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'deep default' );
+}
+
+sub one : Local {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'deep one' );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Default.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Default.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto/Default.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,22 @@
+package TestApp::Controller::Action::Auto::Default;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub begin : Private { }
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ $c->stash->{auto_ran}++;
+ return 1;
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( sprintf 'default (auto: %d)', $c->stash->{auto_ran} );
+}
+
+sub end : Private { }
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Auto.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,21 @@
+package TestApp::Controller::Action::Auto;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ return 1;
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'default' );
+}
+
+sub one : Local {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'one' );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Begin.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Begin.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Begin.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package TestApp::Controller::Action::Begin;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub begin : Private {
+ my ( $self, $c ) = @_;
+ $self->SUPER::begin($c);
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ArgsOrder.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ArgsOrder.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ArgsOrder.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,35 @@
+package TestApp::Controller::Action::Chained::ArgsOrder;
+use warnings;
+use strict;
+
+use base qw( Catalyst::Controller );
+
+#
+# This controller builds a simple chain of three actions that
+# will output the arguments they got passed to @_ after the
+# context object. We do this to test if that passing works
+# as it should.
+#
+
+sub base :Chained('/') PathPart('argsorder') CaptureArgs(0) {
+ my ( $self, $c, $arg ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'base', $arg;
+}
+
+sub index :Chained('base') PathPart('') Args(0) {
+ my ( $self, $c, $arg ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'index', $arg;
+}
+
+sub all :Chained('base') PathPart('') Args() {
+ my ( $self, $c, $arg ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'all', $arg;
+}
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+ no warnings 'uninitialized';
+ $c->response->body( join '; ', @{ $c->stash->{ passed_args } } );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Bar.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Bar.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Bar.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package TestApp::Controller::Action::Chained::Auto::Bar;
+use warnings;
+use strict;
+
+use base qw( Catalyst::Controller );
+
+#
+# Test chain reaction if auto action returns 0.
+#
+sub auto : Private { 0 }
+
+sub barend : Chained('.') Args(1) { }
+
+sub crossloose : Chained PathPart('chained/auto_cross') CaptureArgs(1) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Detach.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Detach.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Detach.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,18 @@
+package TestApp::Controller::Action::Chained::Auto::Detach;
+use warnings;
+use strict;
+
+use base qw( Catalyst::Controller );
+
+#
+# For testing behaviour of a detaching auto action in a chain.
+#
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ $c->detach( '/action/chained/auto/fw3' );
+ return 1;
+}
+
+sub detachend : Chained('/action/chained/auto/dt1') Args(1) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Foo.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Foo.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Foo.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package TestApp::Controller::Action::Chained::Auto::Foo;
+use warnings;
+use strict;
+
+use base qw( Catalyst::Controller );
+
+#
+# Test chain reaction if auto action returns 1.
+#
+sub auto : Private { 1 }
+
+sub fooend : Chained('.') Args(1) { }
+
+sub crossend : Chained('/action/chained/auto/bar/crossloose') Args(1) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Forward.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Forward.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto/Forward.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,18 @@
+package TestApp::Controller::Action::Chained::Auto::Forward;
+use warnings;
+use strict;
+
+use base qw( Catalyst::Controller );
+
+#
+# For testing behaviour of a forwarding auto action in a chain.
+#
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ $c->forward( '/action/chained/auto/fw3' );
+ return 1;
+}
+
+sub forwardend : Chained('/action/chained/auto/fw1') Args(1) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Auto.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,33 @@
+package TestApp::Controller::Action::Chained::Auto;
+use warnings;
+use strict;
+
+use base qw( Catalyst::Controller );
+
+#
+# Provided for sub-auto tests. This just always returns true.
+#
+sub auto : Private { 1 }
+
+#
+# Simple chains with auto actions returning 1 and 0
+#
+sub foo : Chained PathPart('chained/autochain1') CaptureArgs(1) { }
+sub bar : Chained PathPart('chained/autochain2') CaptureArgs(1) { }
+
+#
+# Detaching out of an auto action.
+#
+sub dt1 : Chained PathPart('chained/auto_detach') CaptureArgs(1) { }
+
+#
+# Forwarding out of an auto action.
+#
+sub fw1 : Chained PathPart('chained/auto_forward') CaptureArgs(1) { }
+
+#
+# Target for dispatch and forward tests.
+#
+sub fw3 : Private { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Bar.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Bar.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Bar.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,14 @@
+package TestApp::Controller::Action::Chained::Bar;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Controller/;
+
+#
+# Redispatching between controllers that are not in a parent/child
+# relation. This is the root.
+#
+sub cross1 :PathPart('chained/cross') :CaptureArgs(1) :Chained('/') { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,66 @@
+package TestApp::Controller::Action::Chained::CaptureArgs;
+use warnings;
+use strict;
+
+use base qw( Catalyst::Controller );
+
+#
+# This controller build the following patterns of URI:
+# /captureargs/*/*
+# /captureargs/*/*/edit
+# /captureargs/*
+# /captureargs/*/edit
+# /captureargs/test/*
+# It will output the arguments they got passed to @_ after the
+# context object.
+# /captureargs/one/edit should not dispatch to /captureargs/*/*
+# /captureargs/test/one should not dispatch to /captureargs/*/*
+
+sub base :Chained('/') PathPart('captureargs') CaptureArgs(0) {
+ my ( $self, $c, $arg ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'base';
+}
+
+sub two_args :Chained('base') PathPart('') CaptureArgs(2) {
+ my ( $self, $c, $arg1, $arg2 ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'two_args', $arg1, $arg2;
+}
+
+sub one_arg :Chained('base') ParthPart('') CaptureArgs(1) {
+ my ( $self, $c, $arg ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'one_arg', $arg;
+}
+
+sub edit_two_args :Chained('two_args') PathPart('edit') Args(0) {
+ my ( $self, $c ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'edit_two_args';
+}
+
+sub edit_one_arg :Chained('one_arg') PathPart('edit') Args(0) {
+ my ( $self, $c ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'edit_one_arg';
+}
+
+sub view_two_args :Chained('two_args') PathPart('') Args(0) {
+ my ( $self, $c ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'view_two_args';
+}
+
+sub view_one_arg :Chained('one_arg') PathPart('') Args(0) {
+ my ( $self, $c ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'view_one_arg';
+}
+
+sub test_plus_arg :Chained('base') PathPart('test') Args(1) {
+ my ( $self, $c, $arg ) = @_;
+ push @{ $c->stash->{ passed_args } }, 'test_plus_arg', $arg;
+}
+
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+ no warnings 'uninitialized';
+ $c->response->body( join '; ', @{ $c->stash->{ passed_args } } );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Foo.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Foo.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Foo.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,38 @@
+package TestApp::Controller::Action::Chained::Foo;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Controller/;
+
+#
+# Child of current namespace
+#
+sub spoon :Chained('.') :Args(0) { }
+
+#
+# Root for a action in a "parent" controller
+#
+sub higher_root :PathPart('chained/higher_root') :Chained('/') :CaptureArgs(1) { }
+
+#
+# Parent controller -> this subcontroller -> parent controller test
+#
+sub pcp2 :Chained('/action/chained/pcp1') :CaptureArgs(1) { }
+
+#
+# Controllers not in parent/child relation. This tests the end.
+#
+sub cross2 :PathPart('end') :Chained('/action/chained/bar/cross1') :Args(1) { }
+
+#
+# Create a uri to the root index
+#
+sub to_root : Chained('/') PathPart('action/chained/to_root') {
+ my ( $self, $c ) = @_;
+ my $uri = $c->uri_for_action('/chain_root_index');
+ $c->res->body( "URI:$uri" );
+ $c->stash->{no_end}++;
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain/Relative.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain/Relative.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain/Relative.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,10 @@
+package TestApp::Controller::Action::Chained::ParentChain::Relative;
+use warnings;
+use strict;
+
+use base qw/ Catalyst::Controller /;
+
+# using ../ to go up more than one level
+sub chained_rel_two : Chained('../../one') Args(2) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/ParentChain.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,25 @@
+package TestApp::Controller::Action::Chained::ParentChain;
+use warnings;
+use strict;
+
+use base qw/ Catalyst::Controller /;
+
+#
+# Chains to the action /action/chained/parentchain in the
+# Action::Chained controller.
+#
+sub child :Chained('.') :Args(1) { }
+
+# Should be at /chained/rootdef/*/chained_rel/*/*
+sub chained_rel :Chained('../one') Args(2) {
+}
+
+# Should chain to loose in parent namespace - i.e. at /chained/loose/*/loose/*/*
+sub loose : ChainedParent Args(2) {
+}
+
+# Should be at /chained/cross/*/up_down/*
+sub up_down : Chained('../bar/cross1') Args(1) {
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/PassedArgs.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/PassedArgs.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/PassedArgs.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,34 @@
+package TestApp::Controller::Action::Chained::PassedArgs;
+use warnings;
+use strict;
+
+use base qw( Catalyst::Controller );
+
+#
+# This controller builds a simple chain of three actions that
+# will output the arguments they got passed to @_ after the
+# context object. We do this to test if that passing works
+# as it should.
+#
+
+sub first : PathPart('chained/passedargs/a') Chained('/') CaptureArgs(1) {
+ my ( $self, $c, $arg ) = @_;
+ $c->stash->{ passed_args } = [ $arg ];
+}
+
+sub second : PathPart('b') Chained('first') CaptureArgs(1) {
+ my ( $self, $c, $arg ) = @_;
+ push @{ $c->stash->{ passed_args } }, $arg;
+}
+
+sub third : PathPart('c') Chained('second') Args(1) {
+ my ( $self, $c, $arg ) = @_;
+ push @{ $c->stash->{ passed_args } }, $arg;
+}
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+ $c->response->body( join '; ', @{ $c->stash->{ passed_args } } );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/PathPrefix.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/PathPrefix.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/PathPrefix.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,12 @@
+package TestApp::Controller::Action::Chained::PathPrefix;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Controller/;
+
+# this is kinda the same thing as: sub instance : Path {}
+# it should respond to: /action/chained/pathprefix/*
+sub instance : Chained('/') PathPrefix Args(1) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,13 @@
+package TestApp::Controller::Action::Chained::Root;
+
+use strict;
+use warnings;
+
+use base qw( Catalyst::Controller );
+
+__PACKAGE__->config->{namespace} = '';
+
+sub rootsub : PathPart Chained( '/' ) CaptureArgs( 1 ) { }
+sub endpointsub : PathPart Chained( 'rootsub' ) Args( 1 ) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Chained.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,223 @@
+package TestApp::Controller::Action::Chained;
+
+use strict;
+use warnings;
+
+use HTML::Entities;
+
+use base qw/Catalyst::Controller/;
+
+sub begin :Private { }
+
+#
+# TODO
+# :Chained('') means what?
+#
+
+#
+# Simple parent/child action test
+#
+sub foo :PathPart('chained/foo') :CaptureArgs(1) :Chained('/') {
+ my ( $self, $c, @args ) = @_;
+ die "missing argument" unless @args;
+ die "more than 1 argument" if @args > 1;
+}
+sub endpoint :PathPart('end') :Chained('/action/chained/foo') :Args(1) { }
+
+#
+# Parent/child test with two args each
+#
+sub foo2 :PathPart('chained/foo2') :CaptureArgs(2) :Chained('/') { }
+sub endpoint2 :PathPart('end2') :Chained('/action/chained/foo2') :Args(2) { }
+
+#
+# Relative specification of parent action
+#
+sub bar :PathPart('chained/bar') :Chained('/') :CaptureArgs(0) { }
+sub finale :PathPart('') :Chained('bar') :Args { }
+
+#
+# three chain with concurrent endpoints
+#
+sub one :PathPart('chained/one') :Chained('/') :CaptureArgs(1) { }
+sub two :PathPart('two') :Chained('/action/chained/one') :CaptureArgs(2) { }
+sub three_end :PathPart('three') :Chained('two') :Args(3) { }
+sub one_end :PathPart('chained/one') :Chained('/') :Args(1) { }
+sub two_end :PathPart('two') :Chained('one') :Args(2) { }
+
+#
+# Dispatch on number of arguments
+#
+sub multi1 :PathPart('chained/multi') :Chained('/') :Args(1) { }
+sub multi2 :PathPart('chained/multi') :Chained('/') :Args(2) { }
+
+#
+# Roots in an action defined in a higher controller
+#
+sub higher_root :PathPart('bar') :Chained('/action/chained/foo/higher_root') :Args(1) { }
+
+#
+# Controller -> subcontroller -> controller
+#
+sub pcp1 :PathPart('chained/pcp1') :Chained('/') :CaptureArgs(1) { }
+sub pcp3 :Chained('/action/chained/foo/pcp2') :Args(1) { }
+
+#
+# Dispatch on capture number
+#
+sub multi_cap1 :PathPart('chained/multi_cap') :Chained('/') :CaptureArgs(1) { }
+sub multi_cap2 :PathPart('chained/multi_cap') :Chained('/') :CaptureArgs(2) { }
+sub multi_cap_end1 :PathPart('baz') :Chained('multi_cap1') :Args(0) { }
+sub multi_cap_end2 :PathPart('baz') :Chained('multi_cap2') :Args(0) { }
+
+#
+# Priority: Slurpy args vs. chained actions
+#
+sub priority_a1 :PathPart('chained/priority_a') :Chained('/') :Args { }
+sub priority_a2 :PathPart('chained/priority_a') :Chained('/') :CaptureArgs(1) { }
+sub priority_a2_end :PathPart('end') :Chained('priority_a2') :Args(1) { }
+
+
+#
+# Priority: Fixed args vs. chained actions
+#
+sub priority_b1 :PathPart('chained/priority_b') :Chained('/') :Args(3) { }
+sub priority_b2 :PathPart('chained/priority_b') :Chained('/') :CaptureArgs(1) { }
+sub priority_b2_end :PathPart('end') :Chained('priority_b2') :Args(1) { }
+
+#
+# Priority: With no Args()
+#
+sub priority_c1 :PathPart('chained/priority_c') :Chained('/') :CaptureArgs(1) { }
+sub priority_c2 :PathPart('') :Chained('priority_c1') { }
+sub priority_c2_xyz :PathPart('xyz') :Chained('priority_c1') { }
+
+
+#
+# Optional specification of :Args in endpoint
+#
+sub opt_args :PathPart('chained/opt_args') :Chained('/') { }
+
+#
+# Optional PathPart test -> /chained/optpp/*/opt_pathpart/*
+#
+sub opt_pp_start :Chained('/') :PathPart('chained/optpp') :CaptureArgs(1) { }
+sub opt_pathpart :Chained('opt_pp_start') :Args(1) { }
+
+#
+# Optional Args *and* PathPart -> /chained/optall/*/oa/...
+#
+sub opt_all_start :Chained('/') :PathPart('chained/optall') :CaptureArgs(1) { }
+sub oa :Chained('opt_all_start') { }
+
+#
+# :Chained is the same as :Chained('/')
+#
+sub rootdef :Chained :PathPart('chained/rootdef') :Args(1) { }
+
+#
+# the ParentChain controller chains to this action by
+# specifying :Chained('.')
+#
+sub parentchain :Chained('/') :PathPart('chained/parentchain') :CaptureArgs(1) { }
+
+#
+# This is just for a test that a loose end is not callable
+#
+sub loose :Chained :PathPart('chained/loose') CaptureArgs(1) { }
+
+#
+# Forwarding out of the middle of a chain.
+#
+sub chain_fw_a :Chained :PathPart('chained/chain_fw') :CaptureArgs(1) {
+ $_[1]->forward( '/action/chained/fw_dt_target' );
+}
+sub chain_fw_b :Chained('chain_fw_a') :PathPart('end') :Args(1) { }
+
+#
+# Detaching out of the middle of a chain.
+#
+sub chain_dt_a :Chained :PathPart('chained/chain_dt') :CaptureArgs(1) {
+ $_[1]->detach( '/action/chained/fw_dt_target' );
+}
+sub chain_dt_b :Chained('chain_dt_a') :PathPart('end') :Args(1) { }
+
+#
+# Target for former forward and chain tests.
+#
+sub fw_dt_target :Private { }
+
+#
+# Test multiple chained actions with no captures
+#
+sub empty_chain_a : Chained('/') PathPart('chained/empty') CaptureArgs(0) { }
+sub empty_chain_b : Chained('empty_chain_a') PathPart('') CaptureArgs(0) { }
+sub empty_chain_c : Chained('empty_chain_b') PathPart('') CaptureArgs(0) { }
+sub empty_chain_d : Chained('empty_chain_c') PathPart('') CaptureArgs(1) { }
+sub empty_chain_e : Chained('empty_chain_d') PathPart('') CaptureArgs(0) { }
+sub empty_chain_f : Chained('empty_chain_e') PathPart('') Args(1) { }
+
+sub mult_nopp_base : Chained('/') PathPart('chained/mult_nopp') CaptureArgs(0) { }
+sub mult_nopp_all : Chained('mult_nopp_base') PathPart('') Args(0) { }
+sub mult_nopp_new : Chained('mult_nopp_base') PathPart('new') Args(0) { }
+sub mult_nopp_id : Chained('mult_nopp_base') PathPart('') CaptureArgs(1) { }
+sub mult_nopp_idall : Chained('mult_nopp_id') PathPart('') Args(0) { }
+sub mult_nopp_idnew : Chained('mult_nopp_id') PathPart('new') Args(0) { }
+
+#
+# Test Choice between branches and early return logic
+# Declaration order is important for $children->{$*}, since this is first match best.
+#
+sub cc_base : Chained('/') PathPart('chained/choose_capture') CaptureArgs(0) { }
+sub cc_link : Chained('cc_base') PathPart('') CaptureArgs(0) { }
+sub cc_anchor : Chained('cc_link') PathPart('anchor.html') Args(0) { }
+sub cc_all : Chained('cc_base') PathPart('') Args() { }
+
+sub cc_a : Chained('cc_base') PathPart('') CaptureArgs(1) { }
+sub cc_a_link : Chained('cc_a') PathPart('a') CaptureArgs(0) { }
+sub cc_a_anchor : Chained('cc_a_link') PathPart('') Args() { }
+
+sub cc_b : Chained('cc_base') PathPart('b') CaptureArgs(0) { }
+sub cc_b_link : Chained('cc_b') PathPart('') CaptureArgs(1) { }
+sub cc_b_anchor : Chained('cc_b_link') PathPart('anchor.html') Args() { }
+
+#
+# Test static paths vs. captures
+#
+
+sub apan : Chained('/') CaptureArgs(0) PathPrefix { }
+sub korv : Chained('apan') CaptureArgs(0) PathPart('') { }
+sub wurst : Chained('apan') CaptureArgs(1) PathPart('') { }
+sub static_end : Chained('korv') Args(0) { }
+sub capture_end : Chained('wurst') Args(0) PathPart('') { }
+
+
+# */search vs doc/*
+sub view : Chained('/') PathPart('chained') CaptureArgs(1) {}
+sub star_search : Chained('view') PathPart('search') Args(0) { }
+sub doc_star : Chained('/') PathPart('chained/doc') Args(1) {}
+
+sub return_arg : Chained('view') PathPart('return_arg') Args(1) {}
+
+sub return_arg_decoded : Chained('/') PathPart('chained/return_arg_decoded') Args(1) {
+ my ($self, $c) = @_;
+ $c->req->args([ map { decode_entities($_) } @{ $c->req->args }]);
+}
+
+sub roundtrip_urifor : Chained('/') PathPart('chained/roundtrip_urifor') CaptureArgs(1) {}
+sub roundtrip_urifor_end : Chained('roundtrip_urifor') PathPart('') Args(1) {
+ my ($self, $c) = @_;
+ # This should round-trip, always - i.e. the uri you put in should come back out.
+ $c->res->body($c->uri_for($c->action, $c->req->captures, @{$c->req->args}, $c->req->parameters));
+ $c->stash->{no_end} = 1;
+}
+
+sub end :Private {
+ my ($self, $c) = @_;
+ return if $c->stash->{no_end};
+ my $out = join('; ', map { join(', ', @$_) }
+ ($c->req->captures, $c->req->args));
+ $c->res->body($out);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Default.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Default.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Default.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestApp::Controller::Action::Default;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Detach.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Detach.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Detach.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,45 @@
+package TestApp::Controller::Action::Detach;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub one : Local {
+ my ( $self, $c ) = @_;
+ $c->detach('two');
+ $c->forward('error');
+}
+
+sub two : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub error : Local {
+ my ( $self, $c ) = @_;
+ $c->res->output('error');
+}
+
+sub path : Local {
+ my ( $self, $c ) = @_;
+ $c->detach('/action/detach/two');
+ $c->forward('error');
+}
+
+sub with_args : Local {
+ my ( $self, $c, $orig ) = @_;
+ $c->detach( 'args', [qq/new/] );
+}
+
+sub with_method_and_args : Local {
+ my ( $self, $c, $orig ) = @_;
+ $c->detach( qw/TestApp::Controller::Action::Detach args/, [qq/new/] );
+}
+
+sub args : Local {
+ my ( $self, $c, $val ) = @_;
+ die "Expected argument 'new', got '$val'" unless $val eq 'new';
+ die "passed argument does not match args" unless $val eq $c->req->args->[0];
+ $c->res->body( $c->req->args->[0] );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/End.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/End.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/End.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,15 @@
+package TestApp::Controller::Action::End;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Forward.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Forward.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Forward.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,98 @@
+package TestApp::Controller::Action::Forward;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub one : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('two');
+}
+
+sub two : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('three');
+}
+
+sub three : Local {
+ my ( $self, $c ) = @_;
+ $c->forward( $self, 'four' );
+}
+
+sub four : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('/action/forward/five');
+}
+
+sub five : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('View::Dump::Request');
+}
+
+sub jojo : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('one');
+ $c->forward( $c->controller('Action::Forward'), 'three' );
+}
+
+sub inheritance : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('/action/inheritance/a/b/default');
+ $c->forward('five');
+}
+
+sub global : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('/global_action');
+}
+
+sub with_args : Local {
+ my ( $self, $c, $orig ) = @_;
+ $c->forward( 'args', [qq/new/] );
+ $c->res->body( $c->req->args->[0] );
+}
+
+sub with_method_and_args : Local {
+ my ( $self, $c, $orig ) = @_;
+ $c->forward( qw/TestApp::Controller::Action::Forward args/, [qq/new/] );
+ $c->res->body( $c->req->args->[0] );
+}
+
+sub to_action_object : Local {
+ my ( $self, $c ) = @_;
+ $c->forward($self->action_for('embed'), [qw/mtfnpy/]);
+}
+
+sub args : Local {
+ my ( $self, $c, $val ) = @_;
+ die "Expected argument 'new', got '$val'" unless $val eq 'new';
+ die "passed argument does not match args" unless $val eq $c->req->args->[0];
+}
+
+sub args_embed_relative : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('embed/ok');
+}
+
+sub args_embed_absolute : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('/action/forward/embed/ok');
+}
+
+sub embed : Local {
+ my ( $self, $c, $ok ) = @_;
+
+ $ok ||= 'not ok';
+ $c->res->body($ok);
+}
+
+sub class_forward_test_action : Local {
+ my ( $self, $c ) = @_;
+ $c->forward(qw/TestApp class_forward_test_method/);
+}
+
+sub forward_to_uri_check : Local {
+ my ( $self, $c ) = @_;
+ $c->forward( 'Action::ForwardTo', 'uri_check' );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/ForwardTo.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/ForwardTo.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/ForwardTo.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestApp::Controller::Action::ForwardTo;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub uri_check : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( $c->uri_for('foo/bar')->path );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Global.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Global.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Global.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,21 @@
+package TestApp::Controller::Action::Global;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub action_global_one : Action Absolute {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_global_two : Action Global {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_global_three : Action Path('/action_global_three') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Go.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Go.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Go.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,102 @@
+package TestApp::Controller::Action::Go;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub one : Local {
+ my ( $self, $c ) = @_;
+ $c->go('two');
+}
+
+sub two : Private {
+ my ( $self, $c ) = @_;
+ $c->go('three');
+}
+
+sub three : Local {
+ my ( $self, $c ) = @_;
+ $c->go( $self, 'four' );
+}
+
+sub four : Private {
+ my ( $self, $c ) = @_;
+ $c->go('/action/go/five');
+}
+
+sub five : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('View::Dump::Request');
+}
+
+sub inheritance : Local {
+ my ( $self, $c ) = @_;
+ $c->go('/action/inheritance/a/b/default');
+}
+
+sub global : Local {
+ my ( $self, $c ) = @_;
+ $c->go('/global_action');
+}
+
+sub with_args : Local {
+ my ( $self, $c, $arg ) = @_;
+ $c->go( 'args', [$arg] );
+}
+
+sub with_method_and_args : Local {
+ my ( $self, $c, $arg ) = @_;
+ $c->go( qw/TestApp::Controller::Action::Go args/, [$arg] );
+}
+
+sub args : Local {
+ my ( $self, $c, $val ) = @_;
+ die "passed argument does not match args" unless $val eq $c->req->args->[0];
+ $c->res->body($val);
+}
+
+sub go_die : Local {
+ my ( $self, $c, $val ) = @_;
+ eval { $c->go( 'args', [qq/new/] ) };
+ $c->res->body( $@ ? $@ : "go() did not die" );
+ die $Catalyst::GO;
+}
+
+sub go_chained : Local {
+ my ( $self, $c, $val ) = @_;
+ $c->go('/action/chained/foo/spoon', ['captureme'], [qw/arg1 arg2/]);
+}
+
+sub view : Local {
+ my ( $self, $c, $val ) = @_;
+ eval { $c->go('View::Dump') };
+ $c->res->body( $@ ? $@ : "go() did not die" );
+}
+
+sub model : Local {
+ my ( $self, $c, $val ) = @_;
+ eval { $c->go('Model::Foo') };
+ $c->res->body( $@ ? $@ : "go() did not die" );
+}
+
+sub args_embed_relative : Local {
+ my ( $self, $c ) = @_;
+ $c->go('embed/ok');
+}
+
+sub args_embed_absolute : Local {
+ my ( $self, $c ) = @_;
+ $c->go('/action/go/embed/ok');
+}
+
+sub embed : Local {
+ my ( $self, $c, $ok ) = @_;
+ $ok ||= 'not ok';
+ $c->res->body($ok);
+}
+
+sub class_go_test_action : Local {
+ my ( $self, $c ) = @_;
+ $c->go(qw/TestApp/);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Index.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Index.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Index.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestApp::Controller::Action::Index;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub index : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'Action-Index index' );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Inheritance.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Inheritance.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Inheritance.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,86 @@
+package TestApp::Controller::Action::Inheritance;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ return 1;
+}
+
+sub begin : Private {
+ my ( $self, $c ) = @_;
+ $self->SUPER::begin($c);
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+}
+
+package TestApp::Controller::Action::Inheritance::A;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ return 1;
+}
+
+sub begin : Private {
+ my ( $self, $c ) = @_;
+ $self->SUPER::begin($c);
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+}
+
+package TestApp::Controller::Action::Inheritance::A::B;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ return 1;
+}
+
+sub begin : Private {
+ my ( $self, $c ) = @_;
+ $self->SUPER::begin($c);
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub end : Private {
+ my ( $self, $c ) = @_;
+}
+
+package TestApp::Controller::Action::Inheritance::B;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+# check configuration for an inherited action
+__PACKAGE__->config(
+ action => {
+ begin => {}
+ }
+);
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Local.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Local.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Local.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,31 @@
+package TestApp::Controller::Action::Local;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub one : Action Relative {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub two : Action Local Args(2) {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub three : Action Path('three') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub four : Action Path('four/five/six') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub five : Action Local Args(1) {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Path.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Path.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Path.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,44 @@
+package TestApp::Controller::Action::Path;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+__PACKAGE__->config(
+ actions => {
+ 'one' => { 'Path' => [ 'a path with spaces' ] },
+ 'two' => { 'Path' => "åäö" },
+ 'six' => { 'Local' => undef },
+ },
+);
+
+sub one : Action Path("this_will_be_overriden") {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub two : Action {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub three :Path {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub four : Path( 'spaces_near_parens_singleq' ) {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub five : Path( "spaces_near_parens_doubleq" ) {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub six {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Private.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Private.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Private.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,36 @@
+package TestApp::Controller::Action::Private;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->res->output('access denied');
+}
+
+sub one : Private {
+ my ( $self, $c ) = @_;
+ $c->res->output('access allowed');
+}
+
+sub two : Private {
+ my ( $self, $c ) = @_;
+ $c->res->output('access allowed');
+}
+
+sub three : Private {
+ my ( $self, $c ) = @_;
+ $c->res->output('access allowed');
+}
+
+sub four : Private {
+ my ( $self, $c ) = @_;
+ $c->res->output('access allowed');
+}
+
+sub five : Private {
+ my ( $self, $c ) = @_;
+ $c->res->output('access allowed');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Regexp.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Regexp.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Regexp.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,35 @@
+package TestApp::Controller::Action::Regexp;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub one : Action Regex('^action/regexp/(\w+)/(\d+)$') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub two : Action LocalRegexp('^(\d+)/(\w+)$') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub three : Action LocalRegex('^(mandatory)(/optional)?$'){
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub four : Action Regex('^action/regexp/redirect/(\w+)/universe/(\d+)/everything$') {
+ my ( $self, $c ) = @_;
+ $c->res->redirect(
+ $c->uri_for($c->action, $c->req->captures,
+ @{$c->req->arguments}, $c->req->params
+ )
+ );
+}
+
+sub one_backslashes : Action Regex('^action/regexp/(\w+)/(\d+)\.html$') {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Streaming.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Streaming.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Streaming.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,42 @@
+package TestApp::Controller::Action::Streaming;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub streaming : Global {
+ my ( $self, $c ) = @_;
+ for my $line ( split "\n", <<'EOF' ) {
+foo
+bar
+baz
+EOF
+ $c->res->write("$line\n");
+ }
+}
+
+sub body : Local {
+ my ( $self, $c ) = @_;
+
+ my $file = "$FindBin::Bin/../lib/TestApp/Controller/Action/Streaming.pm";
+ my $fh = IO::File->new( $file, 'r' );
+ if ( defined $fh ) {
+ $c->res->body( $fh );
+ }
+ else {
+ $c->res->body( "Unable to read $file" );
+ }
+}
+
+sub body_large : Local {
+ my ($self, $c) = @_;
+
+ # more than one write with the default chunksize
+ my $size = 128 * 1024;
+
+ my $data = "\0" x $size;
+ open my $fh, '<', \$data;
+ $c->res->content_length($size);
+ $c->res->body($fh);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/TestMultipath.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/TestMultipath.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/TestMultipath.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,21 @@
+package TestApp::Controller::Action::TestMultipath;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+__PACKAGE__->config(
+ namespace => 'action/multipath'
+);
+
+sub multipath : Local : Global : Path('/multipath1') : Path('multipath2') {
+ my ( $self, $c ) = @_;
+ for my $line ( split "\n", <<'EOF' ) {
+foo
+bar
+baz
+EOF
+ $c->res->write("$line\n");
+ }
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/TestRelative.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/TestRelative.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/TestRelative.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,40 @@
+package TestApp::Controller::Action::TestRelative;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+__PACKAGE__->config(
+ path => 'action/relative'
+);
+
+sub relative : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('/action/forward/one');
+}
+
+sub relative_two : Local {
+ my ( $self, $c ) = @_;
+ $c->forward( 'TestApp::Controller::Action::Forward', 'one' );
+}
+
+sub relative_go : Local {
+ my ( $self, $c ) = @_;
+ $c->go('/action/go/one');
+}
+
+sub relative_go_two : Local {
+ my ( $self, $c ) = @_;
+ $c->go( 'TestApp::Controller::Action::Go', 'one' );
+}
+
+sub relative_visit : Local {
+ my ( $self, $c ) = @_;
+ $c->visit('/action/visit/one');
+}
+
+sub relative_visit_two : Local {
+ my ( $self, $c ) = @_;
+ $c->visit( 'TestApp::Controller::Action::Visit', 'one' );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Visit.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Visit.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action/Visit.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,104 @@
+package TestApp::Controller::Action::Visit;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub one : Local {
+ my ( $self, $c ) = @_;
+ $c->visit('two');
+}
+
+sub two : Private {
+ my ( $self, $c ) = @_;
+ $c->visit('three');
+}
+
+sub three : Local {
+ my ( $self, $c ) = @_;
+ $c->visit( $self, 'four' );
+}
+
+sub four : Private {
+ my ( $self, $c ) = @_;
+ $c->visit('/action/visit/five');
+}
+
+sub five : Local {
+ my ( $self, $c ) = @_;
+ $c->forward('View::Dump::Request');
+}
+
+sub inheritance : Local {
+ my ( $self, $c ) = @_;
+ $c->visit('/action/inheritance/a/b/default');
+}
+
+sub global : Local {
+ my ( $self, $c ) = @_;
+ $c->visit('/global_action');
+}
+
+sub with_args : Local {
+ my ( $self, $c, $arg ) = @_;
+ $c->visit( 'args', [$arg] );
+}
+
+sub with_method_and_args : Local {
+ my ( $self, $c, $arg ) = @_;
+ $c->visit( qw/TestApp::Controller::Action::Visit args/, [$arg] );
+}
+
+sub args : Local {
+ my ( $self, $c, $val ) = @_;
+ die "passed argument does not match args" unless $val eq $c->req->args->[0];
+ $c->res->body($val);
+}
+
+sub visit_die : Local {
+ my ( $self, $c, $val ) = @_;
+ eval { $c->visit( 'args', [qq/new/] ) };
+ $c->res->body( $@ ? $@ : "visit() doesn't die" );
+}
+
+sub visit_chained : Local {
+ my ( $self, $c, $val, $capture, @args ) = @_;
+ my @cap_and_args = ([$capture], [@args]);
+ $val eq 1 ? $c->visit( '/action/chained/foo/spoon', @cap_and_args)
+ : $val eq 2 ? $c->visit( qw/ Action::Chained::Foo spoon /, @cap_and_args)
+ : $c->visit( $c->controller('Action::Chained::Foo')->action_for('spoon'), @cap_and_args)
+}
+
+sub view : Local {
+ my ( $self, $c, $val ) = @_;
+ eval { $c->visit('View::Dump') };
+ $c->res->body( $@ ? $@ : "visit() did not die" );
+}
+
+sub model : Local {
+ my ( $self, $c, $val ) = @_;
+ eval { $c->visit('Model::Foo') };
+ $c->res->body( $@ ? $@ : "visit() did not die" );
+}
+
+sub args_embed_relative : Local {
+ my ( $self, $c ) = @_;
+ $c->visit('embed/ok');
+}
+
+sub args_embed_absolute : Local {
+ my ( $self, $c ) = @_;
+ $c->visit('/action/visit/embed/ok');
+}
+
+sub embed : Local {
+ my ( $self, $c, $ok ) = @_;
+ $ok ||= 'not ok';
+ $c->res->body($ok);
+}
+
+sub class_visit_test_action : Local {
+ my ( $self, $c ) = @_;
+ $c->visit(qw/TestApp/);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Action.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,18 @@
+package TestApp::Controller::Action;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub begin : Private {
+ my ( $self, $c ) = @_;
+ $c->res->header( 'X-Test-Class' => ref($self) );
+ $c->response->content_type('text/plain; charset=utf-8');
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->res->output("Error - TestApp::Controller::Action\n");
+ $c->res->status(404);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Anon.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Anon.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Anon.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,39 @@
+package Anon::Trait;
+use Moose::Role -traits => 'MethodAttributes'; # Needed for role composition to work correctly with anon classes.
+
+after test => sub {
+ my ($self, $c) = @_;
+ $c->res->header('X-Anon-Trait-Applied', 1);
+};
+
+no Moose::Role;
+
+package TestApp::Controller::Anon;
+use Moose;
+use Moose::Util qw/find_meta/;
+use namespace::clean -except => 'meta';
+BEGIN { extends 'Catalyst::Controller' };
+
+sub COMPONENT { # Don't do this yourself, use CatalystX::Component::Traits!
+ my ($class, $app, $args) = @_;
+
+ my $meta = $class->meta->create_anon_class(
+ superclasses => [ $class->meta->name ],
+ roles => ['Anon::Trait'],
+ cache => 1,
+ );
+ # Special move as the methodattributes trait has changed our metaclass..
+ $meta = find_meta($meta->name);
+
+ $class = $meta->name;
+ $class->new($app, $args);
+}
+
+sub test : Local ActionClass('+TestApp::Action::TestMyAction') {
+ my ($self, $c) = @_;
+ $c->res->header('X-Component-Name-Controller', $self->catalyst_component_name);
+ $c->res->body('It works');
+}
+
+__PACKAGE__->meta->make_immutable;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Args.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Args.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Args.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package TestApp::Controller::Args;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub args :Local {
+ my ( $self, $c ) = @_;
+ $c->res->body( join('',@{$c->req->args}) );
+}
+
+sub params :Local {
+ my ( $self, $c ) = splice @_, 0, 2;
+ $c->res->body( join('', at _) );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Attributes.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Attributes.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Attributes.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,30 @@
+use strict;
+use warnings;
+
+package My::AttributesBaseClass;
+use base qw( Catalyst::Controller );
+
+sub fetch : Chained('/') PathPrefix CaptureArgs(1) {
+
+}
+
+sub view : PathPart Chained('fetch') Args(0) {
+
+}
+
+sub foo { # no attributes
+
+}
+
+package TestApp::Controller::Attributes;
+use base qw(My::AttributesBaseClass);
+
+sub view { # override attributes to "hide" url
+
+}
+
+sub foo : Local {
+
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/ContextClosure.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/ContextClosure.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/ContextClosure.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,29 @@
+package TestApp::Controller::ContextClosure;
+
+use Moose;
+
+BEGIN {
+ extends 'Catalyst::Controller';
+ with 'Catalyst::Component::ContextClosure';
+}
+
+sub normal_closure : Local {
+ my ($self, $ctx) = @_;
+ $ctx->stash(closure => sub {
+ $ctx->response->body('from normal closure');
+ });
+ $ctx->response->body('stashed normal closure');
+}
+
+sub context_closure : Local {
+ my ($self, $ctx) = @_;
+ $ctx->stash(closure => $self->make_context_closure(sub {
+ my ($ctx) = @_;
+ $ctx->response->body('from context closure');
+ }, $ctx));
+ $ctx->response->body('stashed context closure');
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Dump.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Dump.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Dump.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,33 @@
+package TestApp::Controller::Dump;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub default : Action {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump');
+}
+
+sub env : Action Relative {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Env');
+}
+
+sub request : Action Relative {
+ my ( $self, $c ) = @_;
+ $c->req->params(undef); # Should be a no-op, and be ignored.
+ # Back compat test for 5.7
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub response : Action Relative {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Response');
+}
+
+sub body : Action Relative {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Body');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/URI.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/URI.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/URI.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,104 @@
+package TestApp::Controller::Engine::Request::URI;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub change_path : Local {
+ my ( $self, $c ) = @_;
+
+ # change the path
+ $c->req->path( '/my/app/lives/here' );
+
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub change_base : Local {
+ my ( $self, $c ) = @_;
+
+ # change the base and uri paths
+ $c->req->base->path( '/new/location' );
+ $c->req->uri->path( '/new/location/engine/request/uri/change_base' );
+
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub uri_with : Local {
+ my ( $self, $c ) = @_;
+
+ # change the current uri
+ my $uri = $c->req->uri_with( { b => 1, c => undef } );
+ my %query = $uri->query_form;
+
+ $c->res->header( 'X-Catalyst-Param-a' => $query{ a } );
+ $c->res->header( 'X-Catalyst-Param-b' => $query{ b } );
+ $c->res->header( 'X-Catalyst-Param-c' => exists($query{ c }) ? $query{ c } : '--notexists--' );
+ $c->res->header( 'X-Catalyst-query' => $uri->query);
+
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub uri_with_object : Local {
+ my ( $self, $c ) = @_;
+
+ my $uri = $c->req->uri_with( { a => $c->req->base } );
+ my %query = $uri->query_form;
+
+ $c->res->header( 'X-Catalyst-Param-a' => $query{ a } );
+
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub uri_with_utf8 : Local {
+ my ( $self, $c ) = @_;
+
+ # change the current uri
+ my $uri = $c->req->uri_with( { unicode => "\x{2620}" } );
+
+ $c->res->header( 'X-Catalyst-uri-with' => "$uri" );
+
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub uri_with_undef : Local {
+ my ( $self, $c ) = @_;
+
+ my $warnings = 0;
+ local $SIG{__WARN__} = sub { $warnings++ };
+
+ # change the current uri
+ my $uri = $c->req->uri_with( { foo => undef } );
+
+ $c->res->header( 'X-Catalyst-warnings' => $warnings );
+
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub uri_with_undef_only : Local {
+ my ( $self, $c ) = @_;
+
+ my $uri = $c->req->uri_with( { a => undef } );
+
+ $c->res->header( 'X-Catalyst-uri-with' => "$uri" );
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub uri_with_undef_ignore : Local {
+ my ( $self, $c ) = @_;
+
+ my $uri = $c->req->uri_with( { a => 1, b => undef } );
+
+ my %query = $uri->query_form;
+ $c->res->header( 'X-Catalyst-uri-with' => "$uri" );
+ $c->res->header( 'X-Catalyst-Param-a' => $query{ a } );
+ $c->res->header( 'X-Catalyst-Param-b' => $query{ b } );
+ $c->res->header( 'X-Catalyst-Param-c' => $query{ c } );
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/Uploads.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/Uploads.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Request/Uploads.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,12 @@
+package TestApp::Controller::Engine::Request::Uploads;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub slurp : Relative {
+ my ( $self, $c ) = @_;
+ $c->response->content_type('text/plain; charset=utf-8');
+ $c->response->output( $c->request->upload('slurp')->slurp );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Cookies.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Cookies.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Cookies.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,35 @@
+package TestApp::Controller::Engine::Response::Cookies;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub one : Local {
+ my ( $self, $c ) = @_;
+ $c->res->cookies->{catalyst} = { value => 'cool', path => '/bah' };
+ $c->res->cookies->{cool} = { value => 'catalyst', path => '/' };
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub two : Local {
+ my ( $self, $c ) = @_;
+ $c->res->cookies->{catalyst} = { value => 'cool', path => '/bah' };
+ $c->res->cookies->{cool} = { value => 'catalyst', path => '/' };
+ $c->res->redirect('http://www.google.com/');
+}
+
+sub three : Local {
+ my ( $self, $c ) = @_;
+
+ $c->res->cookies->{object} = CGI::Simple::Cookie->new(
+ -name => "this_is_the_real_name",
+ -value => [qw/foo bar/],
+ );
+
+ $c->res->cookies->{hash} = {
+ value => [qw/a b c/],
+ };
+
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Errors.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Errors.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Errors.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,23 @@
+package TestApp::Controller::Engine::Response::Errors;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub one : Relative {
+ my ( $self, $c ) = @_;
+ my $a = 0;
+ my $b = 0;
+ my $t = $a / $b;
+}
+
+sub two : Relative {
+ my ( $self, $c ) = @_;
+ $c->forward('/non/existing/path');
+}
+
+sub three : Relative {
+ my ( $self, $c ) = @_;
+ die("I'm going to die!\n");
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Headers.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Headers.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Headers.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,14 @@
+package TestApp::Controller::Engine::Response::Headers;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub one : Relative {
+ my ( $self, $c ) = @_;
+ $c->res->header( 'X-Header-Catalyst' => 'Cool' );
+ $c->res->header( 'X-Header-Cool' => 'Catalyst' );
+ $c->res->header( 'X-Header-Numbers' => join ', ', 1 .. 10 );
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Large.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Large.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Large.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package TestApp::Controller::Engine::Response::Large;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub one : Relative {
+ my ( $self, $c ) = @_;
+ $c->res->output( 'x' x (100 * 1024) );
+}
+
+sub two : Relative {
+ my ( $self, $c ) = @_;
+ $c->res->output( 'y' x (1024 * 1024) );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Print.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Print.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Print.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,25 @@
+package TestApp::Controller::Engine::Response::Print;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub one :Relative {
+ my ( $self, $c ) = @_;
+
+ $c->res->print("foo");
+}
+
+sub two :Relative {
+ my ( $self, $c ) = @_;
+
+ $c->res->print(qw/foo bar/);
+}
+
+sub three :Relative {
+ my ( $self, $c ) = @_;
+
+ local $, = ',';
+ $c->res->print(qw/foo bar baz/);
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Redirect.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Redirect.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Redirect.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,29 @@
+package TestApp::Controller::Engine::Response::Redirect;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub one : Relative {
+ my ( $self, $c ) = @_;
+ $c->response->redirect('/test/writing/is/boring');
+}
+
+sub two : Relative {
+ my ( $self, $c ) = @_;
+ $c->response->redirect('http://www.google.com/');
+}
+
+sub three : Relative {
+ my ( $self, $c ) = @_;
+ $c->response->redirect('http://www.google.com/');
+ $c->response->status(301); # Moved Permanently
+}
+
+sub four : Relative {
+ my ( $self, $c ) = @_;
+ $c->response->redirect('http://www.google.com/');
+ $c->response->status(307); # Temporary Redirect
+}
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Status.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Status.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Engine/Response/Status.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,42 @@
+package TestApp::Controller::Engine::Response::Status;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub begin : Private {
+ my ( $self, $c ) = @_;
+ $c->response->content_type('text/plain');
+ return 1;
+}
+
+sub s200 : Relative {
+ my ( $self, $c ) = @_;
+ $c->res->status(200);
+ $c->res->output("200 OK\n");
+}
+
+sub s400 : Relative {
+ my ( $self, $c ) = @_;
+ $c->res->status(400);
+ $c->res->output("400 Bad Request\n");
+}
+
+sub s403 : Relative {
+ my ( $self, $c ) = @_;
+ $c->res->status(403);
+ $c->res->output("403 Forbidden\n");
+}
+
+sub s404 : Relative {
+ my ( $self, $c ) = @_;
+ $c->res->status(404);
+ $c->res->output("404 Not Found\n");
+}
+
+sub s500 : Relative {
+ my ( $self, $c ) = @_;
+ $c->res->status(500);
+ $c->res->output("500 Internal Server Error\n");
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Fork.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Fork.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Fork.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,61 @@
+#!/usr/bin/perl
+# Fork.pm
+# Copyright (c) 2006 Jonathan Rockway <jrockway at cpan.org>
+
+package TestApp::Controller::Fork;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+eval 'use YAML';
+
+sub system : Local {
+ my ($self, $c, $ls) = @_;
+ my ($result, $code) = (undef, 1);
+
+ if(!-e $ls || !-x _){
+ $result = 'skip';
+ }
+ else {
+ $result = system($ls, $ls, $ls);
+ $result = $! if $result != 0;
+ }
+
+ $c->response->body(Dump({result => $result}));
+}
+
+sub backticks : Local {
+ my ($self, $c, $ls) = @_;
+ my ($result, $code) = (undef, 1);
+
+ if(!-e $ls || !-x _){
+ $result = 'skip';
+ $code = 0;
+ }
+ else {
+ $result = `$ls $ls $ls` || $!;
+ $code = $?;
+ }
+
+ $c->response->body(Dump({result => $result, code => $code}));
+}
+
+sub fork : Local {
+ my ($self, $c) = @_;
+ my $pid;
+ my $x = 0;
+
+ if($pid = fork()){
+ $x = "ok";
+ }
+ else {
+ exit(0);
+ }
+
+ waitpid $pid,0 or die;
+
+ $c->response->body(Dump({pid => $pid, result => $x}));
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable/HardToReload.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable/HardToReload.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable/HardToReload.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,30 @@
+package TestApp::Controller::Immutable::HardToReload::Role;
+use Moose::Role; # Role metaclass does not have make_immutable..
+no Moose::Role;
+
+package TestApp::Controller::Immutable::HardToReload;
+use Moose;
+BEGIN { extends 'Catalyst::Controller' }
+no Moose;
+__PACKAGE__->meta->make_immutable;
+
+package # Standard PAUSE hiding technique
+ TestApp::Controller::Immutable::HardToReload::PAUSEHide;
+use Moose;
+BEGIN { extends 'Catalyst::Controller' }
+no Moose;
+__PACKAGE__->meta->make_immutable;
+
+# Not an inner package
+package TestApp::Controller::Immutable2;
+use Moose;
+BEGIN { extends 'Catalyst::Controller' }
+no Moose;
+__PACKAGE__->meta->make_immutable;
+
+# Not even in the app namespace
+package Frobnitz;
+use Moose;
+BEGIN { extends 'Catalyst::Controller' }
+no Moose;
+__PACKAGE__->meta->make_immutable;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Immutable.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,5 @@
+package TestApp::Controller::Immutable;
+use Moose;
+BEGIN { extends 'Catalyst::Controller' }
+no Moose;
+__PACKAGE__->meta->make_immutable;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Index.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Index.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Index.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestApp::Controller::Index;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub index : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'Index index' );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Keyword.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Keyword.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Keyword.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,18 @@
+package TestApp::Controller::Keyword;
+
+use strict;
+use base 'Catalyst::Controller';
+
+#
+# Due to 'actions' being used as an attribute up to cat 5.80003 using this name
+# for an action causes a weird error, as this would be called during BUILD time
+# of the Catalyst::Controller class
+#
+
+sub actions : Local {
+ my ( $self, $c ) = @_;
+ die("Call to controller action method without context! Probably naming clash") unless $c;
+ $c->res->output("Test case for using 'actions' as a catalyst action name\n");
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/MethodModifiers.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/MethodModifiers.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/MethodModifiers.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,10 @@
+package TestApp::Controller::Moose::MethodModifiers;
+use Moose;
+BEGIN { extends qw/TestApp::Controller::Moose/; }
+
+after get_attribute => sub {
+ my ($self, $c) = @_;
+ $c->response->header( 'X-Catalyst-Test-After' => 'after called' );
+};
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/NoAttributes.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/NoAttributes.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose/NoAttributes.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package TestApp::Controller::Moose::NoAttributes;
+use Moose;
+extends qw/Catalyst::Controller/;
+
+__PACKAGE__->config(
+ actions => {
+ test => { Local => undef }
+ }
+);
+
+sub test {
+}
+
+no Moose;
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Moose.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,33 @@
+package TestApp::Controller::Moose;
+
+use Moose;
+
+use namespace::clean -except => 'meta';
+
+BEGIN { extends qw/Catalyst::Controller/; }
+use MooseX::MethodAttributes; # FIXME - You need to say this if you have
+ # modifiers so that you get the correct
+ # method metaclass, why does the modifier
+ # on MODIFY_CODE_ATTRIBUTES not work.
+
+has attribute => (
+ is => 'ro',
+ default => 42,
+);
+
+sub get_attribute : Local {
+ my ($self, $c) = @_;
+ $c->response->body($self->attribute);
+}
+
+sub with_local_modifier : Local {
+ my ($self, $c) = @_;
+ $c->forward('get_attribute');
+}
+
+before with_local_modifier => sub {
+ my ($self, $c) = @_;
+ $c->response->header( 'X-Catalyst-Test-Before' => 'before called' );
+};
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/MultiMethod.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/MultiMethod.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/MultiMethod.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,21 @@
+package TestApp::Controller::Priorities::MultiMethod;
+
+use strict;
+use warnings;
+use base qw/Catalyst::Controller/;
+
+sub auto :Private {
+ my ($self, $c) = @_;
+ $c->res->body(join(' ', $c->action->name, @{$c->req->args}));
+ return 1;
+}
+
+sub zero :Path :Args(0) { }
+
+sub one :Path :Args(1) { }
+
+sub two :Path :Args(2) { }
+
+sub not_def : Path { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/loc_vs_index.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/loc_vs_index.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/loc_vs_index.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestApp::Controller::Priorities::loc_vs_index;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub index :Private { $_[1]->res->body( 'index' ) }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/locre_vs_index.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/locre_vs_index.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/locre_vs_index.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestApp::Controller::Priorities::locre_vs_index;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub index :Private { $_[1]->res->body( 'index' ) }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/path_vs_index.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/path_vs_index.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/path_vs_index.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestApp::Controller::Priorities::path_vs_index;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub index :Private { $_[1]->res->body( 'index' ) }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/re_vs_index.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/re_vs_index.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities/re_vs_index.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestApp::Controller::Priorities::re_vs_index;
+
+use strict;
+use base 'Catalyst::Controller';
+
+sub index :Private { $_[1]->res->body( 'index' ) }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Priorities.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,75 @@
+package TestApp::Controller::Priorities;
+
+use strict;
+use base 'Catalyst::Controller';
+
+#
+# Regex vs. Local
+#
+
+sub re_vs_loc_re :Regex('/priorities/re_vs_loc') { $_[1]->res->body( 'regex' ) }
+sub re_vs_loc :Local { $_[1]->res->body( 'local' ) }
+
+#
+# Regex vs. LocalRegex
+#
+
+sub re_vs_locre_locre :LocalRegex('re_vs_(locre)') { $_[1]->res->body( 'local_regex' ) }
+sub re_vs_locre_re :Regex('/priorities/re_vs_locre') { $_[1]->res->body( 'regex' ) }
+
+#
+# Regex vs. Path
+#
+
+sub re_vs_path_path :Path('/priorities/re_vs_path') { $_[1]->res->body( 'path' ) }
+sub re_vs_path_re :Regex('/priorities/re_vs_path') { $_[1]->res->body( 'regex' ) }
+
+#
+# Local vs. LocalRegex
+#
+
+sub loc_vs_locre_locre :LocalRegex('loc_vs_locre') { $_[1]->res->body( 'local_regex' ) }
+sub loc_vs_locre :Local { $_[1]->res->body( 'local' ) }
+
+#
+# Local vs. Path (depends on definition order)
+#
+
+sub loc_vs_path1_loc :Path('/priorities/loc_vs_path1') { $_[1]->res->body( 'path' ) }
+sub loc_vs_path1 :Local { $_[1]->res->body( 'local' ) }
+
+sub loc_vs_path2 :Local { $_[1]->res->body( 'local' ) }
+sub loc_vs_path2_loc :Path('/priorities/loc_vs_path2') { $_[1]->res->body( 'path' ) }
+
+#
+# Path vs. LocalRegex
+#
+
+sub path_vs_locre_locre :LocalRegex('path_vs_(locre)') { $_[1]->res->body( 'local_regex' ) }
+sub path_vs_locre_path :Path('/priorities/path_vs_locre') { $_[1]->res->body( 'path' ) }
+
+#
+# Regex vs. index (has sub controller)
+#
+
+sub re_vs_idx :Regex('/priorities/re_vs_index') { $_[1]->res->body( 'regex' ) }
+
+#
+# Local vs. index (has sub controller)
+#
+
+sub loc_vs_index :Local { $_[1]->res->body( 'local' ) }
+
+#
+# LocalRegex vs. index (has sub controller)
+#
+
+sub locre_vs_idx :LocalRegex('locre_vs_index') { $_[1]->res->body( 'local_regex' ) }
+
+#
+# Path vs. index (has sub controller)
+#
+
+sub path_vs_idx :Path('/priorities/path_vs_index') { $_[1]->res->body( 'path' ) }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,72 @@
+package TestApp::Controller::Root;
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub chain_root_index : Chained('/') PathPart('') Args(0) { }
+
+sub zero : Path('0') {
+ my ( $self, $c ) = @_;
+ $c->res->header( 'X-Test-Class' => ref($self) );
+ $c->response->content_type('text/plain; charset=utf-8');
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub localregex : LocalRegex('^localregex$') {
+ my ( $self, $c ) = @_;
+ $c->res->header( 'X-Test-Class' => ref($self) );
+ $c->response->content_type('text/plain; charset=utf-8');
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub index : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body('root index');
+}
+
+sub global_action : Private {
+ my ( $self, $c ) = @_;
+ $c->forward('TestApp::View::Dump::Request');
+}
+
+sub class_forward_test_method :Private {
+ my ( $self, $c ) = @_;
+ $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 );
+}
+
+sub loop_test : Local {
+ my ( $self, $c ) = @_;
+
+ for( 1..1001 ) {
+ $c->forward( 'class_forward_test_method' );
+ }
+}
+
+sub recursion_test : Local {
+ my ( $self, $c ) = @_;
+ $c->forward( 'recursion_test' );
+}
+
+sub base_href_test : Local {
+ my ( $self, $c ) = @_;
+
+ my $body = <<"EndOfBody";
+<html>
+ <head>
+ <base href="http://www.example.com/">
+ </head>
+ <body>
+ </body>
+</html>
+EndOfBody
+
+ $c->response->body($body);
+}
+
+sub end : Private {
+ my ($self,$c) = @_;
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/CustomPostLoad.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/CustomPostLoad.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/CustomPostLoad.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,10 @@
+package TestApp::DispatchType::CustomPostLoad;
+use strict;
+use warnings;
+use base qw/Catalyst::DispatchType::Path/;
+
+# Never match anything..
+sub match { }
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/CustomPreLoad.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/CustomPreLoad.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/DispatchType/CustomPreLoad.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,10 @@
+package TestApp::DispatchType::CustomPreLoad;
+use strict;
+use warnings;
+use base qw/Catalyst::DispatchType::Path/;
+
+# Never match anything..
+sub match { }
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/ClosuresInConfig.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/ClosuresInConfig.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/ClosuresInConfig.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,12 @@
+package TestApp::Model::ClosuresInConfig;
+use Moose;
+use namespace::clean -except => 'meta';
+
+extends 'TestApp::Model';
+
+# Note - don't call ->config in here until the constructor calls it to
+# retrieve config, so that we get the 'copy from parent' path,
+# and ergo break due to the closure if dclone is used there..
+
+__PACKAGE__->meta->make_immutable;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo/Bar.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo/Bar.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo/Bar.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,5 @@
+package TestApp::Model::Foo::Bar;
+
+sub model_foo_bar_method_from_foo_bar { "model_foo_bar_method_from_foo_bar" }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Foo.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,20 @@
+package TestApp::Model::Foo;
+
+use strict;
+use warnings;
+
+use base qw/ Catalyst::Model /;
+
+__PACKAGE__->config( 'quux' => 'chunkybacon' );
+
+sub model_foo_method { 1 }
+
+sub model_quux_method { shift->{quux} }
+
+package TestApp::Model::Foo::Bar;
+sub model_foo_bar_method_from_foo { 1 }
+
+package TestApp::Model::Foo;
+sub bar { "TestApp::Model::Foo::Bar" }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Generating.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Generating.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model/Generating.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,22 @@
+package TestApp::Model::Generating;
+use Moose;
+extends 'Catalyst::Model';
+
+sub BUILD {
+ Class::MOP::Class->create(
+ 'TestApp::Model::Generated' => (
+ methods => {
+ foo => sub { 'foo' }
+ }
+ )
+ );
+}
+
+sub expand_modules {
+ return ('TestApp::Model::Generated');
+}
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Model.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package TestApp::Model;
+use Moose;
+use namespace::clean -except => 'meta';
+
+extends 'Catalyst::Model';
+
+# Test a closure here, r10394 made this blow up when we clone the config down
+# onto the subclass..
+__PACKAGE__->config(
+ escape_flags => {
+ 'js' => sub { ${ $_[0] } =~ s/\'/\\\'/g; },
+ }
+);
+
+__PACKAGE__->meta->make_immutable;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/AddDispatchTypes.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/AddDispatchTypes.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/AddDispatchTypes.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,26 @@
+package TestApp::Plugin::AddDispatchTypes;
+use strict;
+use warnings;
+use MRO::Compat;
+
+sub setup_dispatcher {
+ my $class = shift;
+
+ ### Load custom DispatchTypes, as done by Catalyst::Plugin::Server
+ # There should be a waaay less ugly method for doing this,
+ # FIXME in 5.9
+ $class->next::method( @_ );
+ $class->dispatcher->preload_dispatch_types(
+ @{$class->dispatcher->preload_dispatch_types},
+ qw/ +TestApp::DispatchType::CustomPreLoad /
+ );
+ $class->dispatcher->postload_dispatch_types(
+ @{$class->dispatcher->postload_dispatch_types},
+ qw/ +TestApp::DispatchType::CustomPostLoad /
+ );
+
+ return $class;
+}
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/FullyQualified.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/FullyQualified.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/FullyQualified.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,13 @@
+package TestApp::Plugin::FullyQualified;
+
+use strict;
+
+sub fully_qualified {
+ my $c = shift;
+
+ $c->stash->{fully_qualified} = 1;
+
+ return $c;
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/ParameterizedRole.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/ParameterizedRole.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Plugin/ParameterizedRole.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,18 @@
+package TestApp::Plugin::ParameterizedRole;
+
+use MooseX::Role::Parameterized;
+use namespace::autoclean;
+
+parameter method_name => (
+ isa => 'Str',
+ required => 1,
+);
+
+role {
+ my $p = shift;
+ my $method_name = $p->method_name;
+
+ method $method_name => sub { 'birne' };
+};
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/RequestBaseBug.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/RequestBaseBug.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/RequestBaseBug.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,14 @@
+package TestApp::RequestBaseBug;
+
+use base 'Catalyst::Request';
+
+sub uri {
+ my $self = shift;
+
+# this goes into infinite mutual recursion
+ $self->base;
+
+ $self->SUPER::uri(@_)
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/Role.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/Role.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/Role.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,15 @@
+package TestApp::Role;
+use Moose::Role;
+use namespace::clean -except => 'meta';
+
+requires 'fully_qualified'; # Comes from TestApp::Plugin::FullyQualified
+
+our $SETUP_FINALIZE = 0;
+our $SETUP_DISPATCHER = 0;
+
+before 'setup_finalize' => sub { $SETUP_FINALIZE++ };
+
+before 'setup_dispatcher' => sub { $SETUP_DISPATCHER++ };
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Body.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Body.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Body.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestApp::View::Dump::Body;
+
+use strict;
+use base qw[TestApp::View::Dump];
+
+sub process {
+ my ( $self, $c ) = @_;
+ return $self->SUPER::process( $c, $c->request->{_body} ); # FIXME, accessor doesn't work?
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Env.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Env.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Env.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,12 @@
+package TestApp::View::Dump::Env;
+
+use strict;
+use base qw[TestApp::View::Dump];
+
+sub process {
+ my ( $self, $c ) = @_;
+ return $self->SUPER::process( $c, $c->engine->env );
+}
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Request.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Request.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Request.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestApp::View::Dump::Request;
+
+use strict;
+use base qw[TestApp::View::Dump];
+
+sub process {
+ my ( $self, $c ) = @_;
+ return $self->SUPER::process( $c, $c->request );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Response.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Response.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump/Response.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestApp::View::Dump::Response;
+
+use strict;
+use base qw[TestApp::View::Dump];
+
+sub process {
+ my ( $self, $c ) = @_;
+ return $self->SUPER::process( $c, $c->response );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp/View/Dump.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,64 @@
+package TestApp::View::Dump;
+
+use strict;
+use base 'Catalyst::View';
+
+use Data::Dumper ();
+use Scalar::Util qw(blessed weaken);
+
+sub dump {
+ my ( $self, $reference ) = @_;
+
+ return unless $reference;
+
+ my $dumper = Data::Dumper->new( [$reference] );
+ $dumper->Indent(1);
+ $dumper->Purity(1);
+ $dumper->Useqq(0);
+ $dumper->Deepcopy(1);
+ $dumper->Quotekeys(0);
+ $dumper->Terse(1);
+
+ return $dumper->Dump;
+}
+
+sub process {
+ my ( $self, $c, $reference ) = @_;
+
+ # Force processing of on-demand data
+ $c->prepare_body;
+
+ # Remove body from reference if needed
+ $reference->{__body_type} = blessed $reference->body
+ if (blessed $reference->{_body});
+ my $body = delete $reference->{_body};
+
+ # Remove context from reference if needed
+ my $context = delete $reference->{_context};
+
+ if ( my $output =
+ $self->dump( $reference ) )
+ {
+
+ $c->res->headers->content_type('text/plain');
+ $c->res->output($output);
+
+ if ($context) {
+ # Repair context
+ $reference->{_context} = $context;
+ weaken( $reference->{_context} );
+ }
+
+ if ($body) {
+ # Repair body
+ delete $reference->{__body_type};
+ $reference->{_body} = $body;
+ }
+
+ return 1;
+ }
+
+ return 0;
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestApp.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestApp.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestApp.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,127 @@
+package TestApp;
+
+use strict;
+use Catalyst qw/
+ Test::MangleDollarUnderScore
+ Test::Errors
+ Test::Headers
+ Test::Plugin
+ Test::Inline
+ +TestApp::Plugin::FullyQualified
+ +TestApp::Plugin::AddDispatchTypes
+ +TestApp::Role
+/;
+use Catalyst::Utils;
+
+use Moose;
+use namespace::autoclean;
+
+# -----------
+# t/aggregate/unit_core_ctx_attr.t pukes until lazy is true
+package Greeting;
+use Moose;
+sub hello_notlazy { 'hello there' }
+sub hello_lazy { 'hello there' }
+
+package TestApp;
+has 'my_greeting_obj_notlazy' => (
+ is => 'ro',
+ isa => 'Greeting',
+ default => sub { Greeting->new() },
+ handles => [ qw( hello_notlazy ) ],
+ lazy => 0,
+);
+has 'my_greeting_obj_lazy' => (
+ is => 'ro',
+ isa => 'Greeting',
+ default => sub { Greeting->new() },
+ handles => [ qw( hello_lazy ) ],
+ lazy => 1,
+);
+# -----------
+
+our $VERSION = '0.01';
+
+TestApp->config( name => 'TestApp', root => '/some/dir', use_request_uri_for_path => 1 );
+
+# Test bug found when re-adjusting the metaclass compat code in Moose
+# in 292360. Test added to Moose in 4b760d6, but leave this attribute
+# above ->setup so we have some generated methods to be double sure.
+has an_attribute_before_we_change_base_classes => ( is => 'ro');
+
+if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
+ with 'CatalystX::LeakChecker';
+
+ has leaks => (
+ is => 'ro',
+ default => sub { [] },
+ );
+}
+
+sub found_leaks {
+ my ($ctx, @leaks) = @_;
+ push @{ $ctx->leaks }, @leaks;
+}
+
+sub count_leaks {
+ my ($ctx) = @_;
+ return scalar @{ $ctx->leaks };
+}
+
+TestApp->setup;
+
+sub execute {
+ my $c = shift;
+ my $class = ref( $c->component( $_[0] ) ) || $_[0];
+ my $action = $_[1]->reverse;
+
+ my $method;
+
+ if ( $action =~ /->(\w+)$/ ) {
+ $method = $1;
+ }
+ elsif ( $action =~ /\/(\w+)$/ ) {
+ $method = $1;
+ }
+ elsif ( $action =~ /^(\w+)$/ ) {
+ $method = $action;
+ }
+
+ if ( $class && $method && $method !~ /^_/ ) {
+ my $executed = sprintf( "%s->%s", $class, $method );
+ my @executed = $c->response->headers->header('X-Catalyst-Executed');
+ push @executed, $executed;
+ $c->response->headers->header(
+ 'X-Catalyst-Executed' => join ', ',
+ @executed
+ );
+ }
+ no warnings 'recursion';
+ return $c->SUPER::execute(@_);
+}
+
+# Replace the very large HTML error page with
+# useful info if something crashes during a test
+sub finalize_error {
+ my $c = shift;
+
+ $c->next::method(@_);
+
+ $c->res->status(500);
+ $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
+}
+
+{
+ no warnings 'redefine';
+ sub Catalyst::Log::error { }
+}
+
+# Make sure we can load Inline plugins.
+
+package Catalyst::Plugin::Test::Inline;
+
+use strict;
+
+use base qw/Class::Data::Inheritable/;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppBadlyImmutable.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppBadlyImmutable.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppBadlyImmutable.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,12 @@
+package TestAppBadlyImmutable;
+use Catalyst qw/+TestPluginWithConstructor/;
+use Test::More;
+
+__PACKAGE__->setup;
+
+ok !__PACKAGE__->meta->is_immutable, 'Am not already immutable';
+__PACKAGE__->meta->make_immutable( inline_constructor => 0 );
+ok __PACKAGE__->meta->is_immutable, 'Am now immutable';
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart/Controller/Foo.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart/Controller/Foo.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart/Controller/Foo.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,10 @@
+package TestAppChainedAbsolutePathPart::Controller::Foo;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Controller/;
+
+sub foo : Chained PathPart('/foo/bar') Args(1) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedAbsolutePathPart.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,20 @@
+package TestAppChainedAbsolutePathPart;
+
+use strict;
+use Catalyst qw/
+ Test::Errors
+ Test::Headers
+/;
+use Catalyst::Utils;
+
+our $VERSION = '0.01';
+
+TestAppChainedAbsolutePathPart
+ ->config(
+ name => 'TestAppChainedAbsolutePathPart',
+ root => '/some/dir'
+ );
+
+TestAppChainedAbsolutePathPart->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive/Controller/Foo.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive/Controller/Foo.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive/Controller/Foo.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestAppChainedRecursive::Controller::Foo;
+
+use strict;
+use warnings;
+
+use base qw/Catalyst::Controller/;
+
+sub foo : Chained('bar') CaptureArgs(1) { }
+sub bar : Chained('foo') CaptureArgs(1) { }
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppChainedRecursive.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,19 @@
+package TestAppChainedRecursive;
+
+use strict;
+use Catalyst qw/
+ Test::Errors
+ Test::Headers
+/;
+use Catalyst::Utils;
+
+our $VERSION = '0.01';
+
+TestAppChainedRecursive->config(
+ name => 'TestAppChainedRecursive',
+ root => '/some/dir'
+);
+
+TestAppChainedRecursive->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppClassExceptionSimpleTest.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppClassExceptionSimpleTest.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppClassExceptionSimpleTest.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,21 @@
+package TestAppClassExceptionSimpleTest::Exception;
+use strict;
+use warnings;
+
+sub throw {}
+
+#########
+
+package TestAppClassExceptionSimpleTest;
+use strict;
+use warnings;
+
+use Catalyst::Utils; #< some of the scripts use Catalyst::Utils before MyApp.pm
+
+BEGIN { $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'TestAppClassExceptionSimpleTest::Exception'; }
+
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,22 @@
+package TestAppDoubleAutoBug::Controller::Root;
+
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ ++$c->stash->{auto_count};
+ return 1;
+}
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->res->body( sprintf 'default, auto=%d', $c->stash->{auto_count} );
+}
+
+sub end : Private {
+ my ($self,$c) = @_;
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppDoubleAutoBug.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,49 @@
+use strict;
+use warnings;
+
+package TestAppDoubleAutoBug;
+
+use Catalyst qw/
+ Test::Errors
+ Test::Headers
+ Test::Plugin
+/;
+
+our $VERSION = '0.01';
+
+__PACKAGE__->config( name => 'TestAppDoubleAutoBug', root => '/some/dir' );
+
+__PACKAGE__->setup;
+
+sub execute {
+ my $c = shift;
+ my $class = ref( $c->component( $_[0] ) ) || $_[0];
+ my $action = $_[1]->reverse();
+
+ my $method;
+
+ if ( $action =~ /->(\w+)$/ ) {
+ $method = $1;
+ }
+ elsif ( $action =~ /\/(\w+)$/ ) {
+ $method = $1;
+ }
+ elsif ( $action =~ /^(\w+)$/ ) {
+ $method = $action;
+ }
+
+ if ( $class && $method && $method !~ /^_/ ) {
+ my $executed = sprintf( "%s->%s", $class, $method );
+ my @executed = $c->response->headers->header('X-Catalyst-Executed');
+ push @executed, $executed;
+ $c->response->headers->header(
+ 'X-Catalyst-Executed' => join ', ',
+ @executed
+ );
+ }
+
+ return $c->SUPER::execute(@_);
+}
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,48 @@
+package TestAppEncoding::Controller::Root;
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+use Test::More;
+
+__PACKAGE__->config->{namespace} = '';
+
+sub binary : Local {
+ my ($self, $c) = @_;
+ $c->res->body(do {
+ open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!;
+ binmode($fh);
+ local $/ = undef; <$fh>;
+ });
+}
+
+sub binary_utf8 : Local {
+ my ($self, $c) = @_;
+ $c->forward('binary');
+ my $str = $c->res->body;
+ utf8::upgrade($str);
+ ok utf8::is_utf8($str), 'Body is variable width encoded string';
+ $c->res->body($str);
+}
+
+# called by t/aggregate/catalyst_test_utf8.t
+sub utf8_non_ascii_content : Local {
+ use utf8;
+ my ($self, $c) = @_;
+
+ my $str = 'ʇsʎlɐʇɐɔ'; # 'catalyst' flipped at http://www.revfad.com/flip.html
+ ok utf8::is_utf8($str), '$str is in UTF8 internally';
+
+ # encode $str into a sequence of octets and turn off the UTF-8 flag, so that
+ # we don't get the 'Wide character in syswrite' error in Catalyst::Engine
+ utf8::encode($str);
+ ok !utf8::is_utf8($str), '$str is a sequence of octets (byte string)';
+
+ $c->res->body($str);
+}
+
+
+sub end : Private {
+ my ($self,$c) = @_;
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppEncoding.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,11 @@
+package TestAppEncoding;
+use strict;
+use warnings;
+use base qw/Catalyst/;
+use Catalyst;
+
+__PACKAGE__->config(name => __PACKAGE__);
+__PACKAGE__->setup;
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/Default.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/Default.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/Default.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,15 @@
+package TestAppIndexDefault::Controller::Default;
+
+use base 'Catalyst::Controller';
+
+sub default : Private {
+ my ($self, $c) = @_;
+ $c->res->body('default_default');
+}
+
+sub path_one_arg : Path('/default/') Args(1) {
+ my ($self, $c) = @_;
+ $c->res->body('default_path_one_arg');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/IndexChained.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/IndexChained.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/IndexChained.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,12 @@
+package TestAppIndexDefault::Controller::IndexChained;
+
+use base 'Catalyst::Controller';
+
+sub index : Chained('/') PathPart('indexchained') CaptureArgs(0) {}
+
+sub index_endpoint : Chained('index') PathPart('') Args(0) {
+ my ($self, $c) = @_;
+ $c->res->body('index_chained');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/IndexPrivate.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/IndexPrivate.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/IndexPrivate.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,10 @@
+package TestAppIndexDefault::Controller::IndexPrivate;
+
+use base 'Catalyst::Controller';
+
+sub index : Private {
+ my ($self, $c) = @_;
+ $c->res->body('index_private');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,17 @@
+package TestAppIndexDefault::Controller::Root;
+
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub default : Private {
+ my ($self, $c) = @_;
+ $c->res->body('default');
+}
+
+sub path_one_arg : Path('/') Args(1) {
+ my ($self, $c) = @_;
+ $c->res->body('path_one_arg');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppIndexDefault.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestAppIndexDefault;
+use strict;
+use warnings;
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,24 @@
+package TestAppMatchSingleArg::Controller::Root;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub match_single : Path Args(1) {
+ my ($self, $c) = @_;
+ $c->res->body('Path Args(1)');
+}
+
+sub match_other : Path {
+ my ($self, $c) = @_;
+ $c->res->body('Path');
+}
+
+sub match_two : Path Args(2) {
+ my ($self, $c) = @_;
+ $c->res->body('Path Args(2)');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppMatchSingleArg.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestAppMatchSingleArg;
+use strict;
+use warnings;
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/Base.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/Base.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/Base.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,6 @@
+package TestAppMetaCompat::Controller::Base;
+
+use strict;
+use base qw/Catalyst::Controller/;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/Books.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/Books.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat/Controller/Books.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestAppMetaCompat::Controller::Books;
+
+use strict;
+use base qw/TestAppMetaCompat::Controller::Base/;
+
+sub edit : Local {}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppMetaCompat.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestAppMetaCompat;
+use base qw/Catalyst/;
+
+__PACKAGE__->config(name => __PACKAGE__);
+__PACKAGE__->setup;
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/Controller/Foo.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/Controller/Foo.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/Controller/Foo.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,5 @@
+package TestAppNonMooseController::Controller::Foo;
+use base qw/TestAppNonMooseController::ControllerBase/;
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/ControllerBase.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/ControllerBase.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController/ControllerBase.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,5 @@
+package TestAppNonMooseController::ControllerBase;
+use base qw/Catalyst::Controller/;
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppNonMooseController.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestAppNonMooseController;
+use base qw/Catalyst/;
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand/Controller/Body.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand/Controller/Body.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand/Controller/Body.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,41 @@
+package TestAppOnDemand::Controller::Body;
+
+use strict;
+use base 'Catalyst::Controller';
+
+use Data::Dump ();
+
+sub body_params : Local {
+ my ( $self, $c ) = @_;
+
+ $c->res->body( Data::Dump::dump( $c->req->body_parameters ) );
+}
+
+sub query_params : Local {
+ my ( $self, $c ) = @_;
+
+ $c->res->body( Data::Dump::dump( $c->req->query_parameters ) );
+}
+
+sub params : Local {
+ my ( $self, $c ) = @_;
+
+ $c->res->body( Data::Dump::dump( $c->req->parameters ) );
+}
+
+sub read : Local {
+ my ( $self, $c ) = @_;
+
+ # read some data
+ my @chunks;
+
+ while ( my $data = $c->read( 10_000 ) ) {
+ push @chunks, $data;
+ }
+
+ $c->res->content_type( 'text/plain');
+
+ $c->res->body( join ( '|', map { length $_ } @chunks ) );
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppOnDemand.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,20 @@
+package TestAppOnDemand;
+
+use strict;
+use Catalyst qw/
+ Test::Errors
+ Test::Headers
+/;
+use Catalyst::Utils;
+
+our $VERSION = '0.01';
+
+__PACKAGE__->config(
+ name => __PACKAGE__,
+ root => '/some/dir',
+ parse_on_demand => 1,
+);
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,34 @@
+package TestAppOneView::Controller::Root;
+
+use base 'Catalyst::Controller';
+use Scalar::Util ();
+
+__PACKAGE__->config->{namespace} = '';
+
+sub view_no_args : Local {
+ my ( $self, $c ) = @_;
+
+ my $v = $c->view;
+
+ $c->res->body(Scalar::Util::blessed($v));
+}
+
+sub view_by_name : Local {
+ my ( $self, $c ) = @_;
+
+ my $v = $c->view($c->req->param('view'));
+
+ $c->res->body(Scalar::Util::blessed($v));
+}
+
+sub view_by_regex : Local {
+ my ( $self, $c ) = @_;
+
+ my $v_name = $c->req->param('view');
+
+ my ($v) = $c->view(qr/$v_name/);
+
+ $c->res->body(Scalar::Util::blessed($v));
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/View/Dummy.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/View/Dummy.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView/View/Dummy.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,13 @@
+package TestAppOneView::View::Dummy;
+
+use base 'Catalyst::View';
+
+sub COMPONENT {
+ bless {}, 'AClass'
+}
+
+package AClass;
+
+use base 'Catalyst::View';
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppOneView.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,8 @@
+package TestAppOneView;
+use strict;
+use warnings;
+use Catalyst;
+
+__PACKAGE__->setup;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppPathBug.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppPathBug.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppPathBug.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+
+package TestAppPathBug;
+use strict;
+use warnings;
+use Catalyst;
+
+our $VERSION = '0.01';
+
+__PACKAGE__->config( name => 'TestAppPathBug', root => '/some/dir' );
+
+__PACKAGE__->log(TestAppPathBug::Log->new);
+__PACKAGE__->setup;
+
+sub foo : Path {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'This is the foo method.' );
+}
+
+package TestAppPathBug::Log;
+use strict;
+use warnings;
+use base qw/Catalyst::Log/;
+
+sub warn {}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,12 @@
+package TestAppPluginWithConstructor::Controller::Root;
+
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub foo : Local {
+ my ($self, $c) = @_;
+ $c->res->body('foo');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppPluginWithConstructor.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,21 @@
+# See t/plugin_new_method_backcompat.t
+package TestAppPluginWithConstructor;
+use Test::More;
+use Test::Exception;
+use Catalyst qw/+TestPluginWithConstructor/;
+use Moose;
+extends qw/Catalyst/;
+
+__PACKAGE__->setup;
+our $MODIFIER_FIRED = 0;
+
+lives_ok {
+ before 'dispatch' => sub { $MODIFIER_FIRED = 1 }
+} 'Can apply method modifier';
+no Moose;
+
+our $IS_IMMUTABLE_YET = __PACKAGE__->meta->is_immutable;
+ok !$IS_IMMUTABLE_YET, 'I am not immutable yet';
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,19 @@
+package TestAppShowInternalActions::Controller::Root;
+use Moose;
+use namespace::autoclean;
+
+BEGIN { extends 'Catalyst::Controller' }
+
+__PACKAGE__->config(namespace => '');
+
+sub index :Path :Args(0) {
+ my ( $self, $c ) = @_;
+
+ $c->response->body( 'hello world' );
+}
+
+sub end : Action {}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppShowInternalActions.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,20 @@
+package TestAppShowInternalActions;
+use Moose;
+use namespace::autoclean;
+
+use Catalyst::Runtime 5.80;
+
+use Catalyst qw/ -Debug /; # Debug must remain on for
+ # t/live_show_internal_actions_warnings.t
+
+extends 'Catalyst';
+
+__PACKAGE__->config(
+ name => 'TestAppShowInternalActions',
+ disable_component_resolution_regex_fallback => 1,
+ show_internal_actions => 1,
+);
+
+__PACKAGE__->setup();
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppStats/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppStats/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppStats/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,16 @@
+package TestAppStats::Controller::Root;
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+# Return log messages from previous request
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->stats->profile("test");
+ $c->res->body(join("\n", @TestAppStats::log_messages));
+ @TestAppStats::log_messages = ();
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppStats.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppStats.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppStats.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,26 @@
+use strict;
+use warnings;
+
+package TestAppStats;
+
+use Catalyst qw/
+ -Stats=1
+/;
+
+our $VERSION = '0.01';
+our @log_messages;
+
+__PACKAGE__->config( name => 'TestAppStats', root => '/some/dir' );
+
+__PACKAGE__->log(TestAppStats::Log->new);
+
+__PACKAGE__->setup;
+
+package TestAppStats::Log;
+use base qw/Catalyst::Log/;
+
+sub info { push(@TestAppStats::log_messages, @_); }
+sub debug { push(@TestAppStats::log_messages, @_); }
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppToTestScripts.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppToTestScripts.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppToTestScripts.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,14 @@
+package TestAppToTestScripts;
+use strict;
+use warnings;
+use Carp;
+
+our @RUN_ARGS;
+
+sub run {
+ @RUN_ARGS = @_;
+ 1; # Does this work?
+}
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppUnknownError.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppUnknownError.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppUnknownError.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,22 @@
+package TestApp;
+
+use strict;
+use warnings;
+
+use Catalyst::Runtime 5.70;
+
+use base qw/Catalyst/;
+
+use Catalyst;
+
+__PACKAGE__->setup();
+
+sub _test {
+ my $self = shift;
+ $self->_method_which_does_not_exist;
+}
+
+__PACKAGE__->_test;
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,17 @@
+package TestAppViewWarnings::Controller::Root;
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+# Return log messages from previous request
+sub index :Path Args() {}
+
+sub end : Action {
+ my ($self, $c) = @_;
+ $c->view; # Cause view lookup and ergo warning we are testing.
+ $c->res->body('foo');
+}
+
+1;
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppViewWarnings.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+package TestAppViewWarnings;
+
+use Catalyst;
+
+our @log_messages;
+
+__PACKAGE__->config( name => 'TestAppWarnings', root => '/some/dir', default_view => "DoesNotExist" );
+
+__PACKAGE__->log(TestAppViewWarnings::Log->new);
+
+__PACKAGE__->setup;
+
+package TestAppViewWarnings::Log;
+
+use base qw/Catalyst::Log/;
+sub warn { push(@TestAppViewWarnings::log_messages, @_[1..$#_]); }
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta/Controller/Root.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta/Controller/Root.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta/Controller/Root.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,17 @@
+package TestAppWithMeta::Controller::Root;
+use base qw/Catalyst::Controller/; # N.B. Do not convert to Moose, so we do not
+ # have a metaclass instance!
+
+__PACKAGE__->config( namespace => '' );
+
+no warnings 'redefine';
+sub meta { 'fnar' }
+use warnings 'redefine';
+
+sub default : Private {
+ my ($self, $c) = @_;
+ $c->res->body($self->meta);
+}
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestAppWithMeta.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,13 @@
+package TestAppWithMeta;
+use strict;
+use warnings;
+use Catalyst;
+
+no warnings 'redefine';
+sub meta {}
+use warnings 'redefine';
+
+__PACKAGE__->setup;
+
+1;
+
Added: Catalyst-Engine-Apache/trunk/t/lib/TestPluginWithConstructor.pm
===================================================================
--- Catalyst-Engine-Apache/trunk/t/lib/TestPluginWithConstructor.pm (rev 0)
+++ Catalyst-Engine-Apache/trunk/t/lib/TestPluginWithConstructor.pm 2010-10-04 19:17:09 UTC (rev 13639)
@@ -0,0 +1,17 @@
+# See t/plugin_new_method_backcompat.t
+package Class::Accessor::Fast;
+use strict;
+use warnings;
+
+sub new {
+ my $class = shift;
+ return bless $_[0], $class;
+}
+
+package TestPluginWithConstructor;
+use strict;
+use warnings;
+use base qw/Class::Accessor::Fast/;
+
+1;
+
More information about the Catalyst-commits
mailing list