only import Test::Exception where it is needed
[catagits/Catalyst-Plugin-Authentication.git] / t / lib / AuthRealmTestAppProgressive / Controller / Root.pm
CommitLineData
d055ce0c 1package AuthRealmTestAppProgressive::Controller::Root;
2use warnings;
3use strict;
4use base qw/Catalyst::Controller/;
5
6__PACKAGE__->config(namespace => '');
7
8use Test::More;
d055ce0c 9
10sub progressive : Local {
fb90f091 11 my ( $self, $c ) = @_;
d055ce0c 12
13 foreach my $realm ( keys %AuthRealmTestAppProgressive::members ) {
14 while ( my ( $user, $info ) = each %{$AuthRealmTestAppProgressive::members{$realm}} ) {
15 my $ok = eval {
16 $c->authenticate(
17 { username => $user, password => $info->{password} },
18 );
19 };
20 ok( !$@, "authentication passed." );
21 ok( $ok, "user authenticated" );
22 ok( $c->user_in_realm($realm), "user in proper realm" );
23 }
24 }
fb90f091 25 $c->res->body( "ok" );
d055ce0c 26}
27
281;
29