BEGIN {
eval { require Catalyst::Plugin::Session; require Catalyst::Plugin::Session::State::Cookie };
- if ($@) {
- plan skip_all => "This test needs Catalyst::Plugin::Session and Catalyst::Plugin::Session::State::Cookie installed";
- } else {
- plan tests => 12;
- }
+ plan skip_all => "This test needs Catalyst::Plugin::Session and Catalyst::Plugin::Session::State::Cookie installed" if $@;
+ plan tests => 12;
}
{
+ package User::SessionRestoring;
+ use base qw/Catalyst::Plugin::Authentication::User::Hash/;
+
+ sub for_session { $_[0]->id }
+ sub store { $_[0]->{store} }
+
package AuthTestApp;
use Catalyst qw/
Session
}
__PACKAGE__->config->{authentication}{users} = $users = {
- foo => {
+ foo => User::SessionRestoring->new(
+ id => 'foo',
password => "s3cr3t",
- },
+ ),
};
__PACKAGE__->setup;
+
+ $users->{foo}{store} = __PACKAGE__->default_auth_store;
}
use Test::WWW::Mechanize::Catalyst qw/AuthTestApp/; # for the cookie support