Epic cleanup and code shuffle in tests to avoid warnings
[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;
9use Test::Exception;
10
11sub progressive : Local {
12 my ( $self, $c ) = @_;
13
14 foreach my $realm ( keys %AuthRealmTestAppProgressive::members ) {
15 while ( my ( $user, $info ) = each %{$AuthRealmTestAppProgressive::members{$realm}} ) {
16 my $ok = eval {
17 $c->authenticate(
18 { username => $user, password => $info->{password} },
19 );
20 };
21 ok( !$@, "authentication passed." );
22 ok( $ok, "user authenticated" );
23 ok( $c->user_in_realm($realm), "user in proper realm" );
24 }
25 }
26 $c->res->body( "ok" );
27}
28
291;
30