1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!/usr/bin/perl
use Test::More;
use lib 't/lib';
eval "use CGI::Application::Plugin::Session";
plan skip_all => "CGI::Application::Plugin::Session required for this test"
if $@;
eval "use DBD::SQLite";
plan skip_all => "DBD::SQLite required for this test"
if $@;
plan tests => 3;
use strict;
use warnings;
use CGI ();
use TestAppAuthcrypt;
use TestUsers;
use File::Path;
mkpath(['t/db']);
TestUsers->setuptables;
$ENV{CGI_APP_RETURN_ONLY} = 1;
my $query = CGI->new(
{
auth_username => 'usercrypt',
auth_password => 'testpassword',
rm => 'two'
}
);
my $cgiapp = TestAppAuthcrypt->new( QUERY => $query );
my $results = $cgiapp->run;
ok( $cgiapp->authen->is_authenticated, 'successful login crypt' );
is( $cgiapp->authen->username, 'usercrypt',
'successful login crypt - username set' );
is( $cgiapp->authen->login_attempts,
0, "successful login crypt - failed login count" );
END {
rmtree(['t/db']);
}
|