X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FRemoteTestApp1.pm;h=30c3831aaaf1e9dfcd80dfab17fa4c5660cecfe7;hb=afa31b0172e05d85451eb7b56ea663d5f765b7b7;hp=dbba67c635e1bbb17b472d7cbf3b7cbf8ab370d6;hpb=0de2d0935e9fd36c8b78db3cbae6d342cd963adf;p=catagits%2FCatalyst-Plugin-Authentication.git diff --git a/t/lib/RemoteTestApp1.pm b/t/lib/RemoteTestApp1.pm index dbba67c..30c3831 100644 --- a/t/lib/RemoteTestApp1.pm +++ b/t/lib/RemoteTestApp1.pm @@ -1,11 +1,14 @@ package RemoteTestApp1; - +use strict; +use warnings; use Catalyst qw/ Authentication /; use base qw/Catalyst/; -__PACKAGE__->engine_class('RemoteTestEngine'); +unless ($Catalyst::VERSION >= 5.89000) { + __PACKAGE__->engine_class('RemoteTestEngine'); +} __PACKAGE__->config( 'Plugin::Authentication' => { default_realm => 'remote', @@ -24,22 +27,11 @@ __PACKAGE__->config( }, }, ); - -sub default : Local { - my ( $self, $c ) = @_; - if ($c->authenticate()) { - $c->res->body('User:' . $c->user->{username}); - } - else { - $c->res->body('FAIL'); - $c->res->status(403); - } -} - -sub public : Local { - my ( $self, $c ) = @_; - $c->res->body('OK'); +__PACKAGE__->setup; +if ($Catalyst::VERSION >= 5.89000) { + require RemoteTestEngineRole; + RemoteTestEngineRole->meta->apply(__PACKAGE__->engine); } -__PACKAGE__->setup; +1;