|
Lines 10-16
use CGI qw ( -utf8 );
Link Here
|
| 10 |
use Test::MockObject; |
10 |
use Test::MockObject; |
| 11 |
use Test::MockModule; |
11 |
use Test::MockModule; |
| 12 |
use List::MoreUtils qw/all any none/; |
12 |
use List::MoreUtils qw/all any none/; |
| 13 |
use Test::More tests => 15; |
13 |
use Test::More tests => 16; |
| 14 |
use Test::Warn; |
14 |
use Test::Warn; |
| 15 |
use t::lib::Mocks; |
15 |
use t::lib::Mocks; |
| 16 |
use t::lib::TestBuilder; |
16 |
use t::lib::TestBuilder; |
|
Lines 425-430
subtest 'Check value of login_attempts in checkpw' => sub {
Link Here
|
| 425 |
is( $patron->account_locked, 1, 'Check administrative lockout without pref' ); |
425 |
is( $patron->account_locked, 1, 'Check administrative lockout without pref' ); |
| 426 |
}; |
426 |
}; |
| 427 |
|
427 |
|
|
|
428 |
subtest 'Check value of login_attempts in checkpw' => sub { |
| 429 |
plan tests => 2; |
| 430 |
|
| 431 |
t::lib::Mocks::mock_preference('FailedLoginAttempts', 3); |
| 432 |
my $patron = $builder->build_object({ class => 'Koha::Patrons' }); |
| 433 |
$patron->set_password({ password => '123', skip_validation => 1 }); |
| 434 |
|
| 435 |
my @test = checkpw( $dbh, $patron->userid, '123', undef, 'opac', 1 ); |
| 436 |
is( $test[0], 1, 'Patron authenticated correctly' ); |
| 437 |
|
| 438 |
$patron->password_expiration_date('2020-01-01')->store; |
| 439 |
@test = checkpw( $dbh, $patron->userid, '123', undef, 'opac', 1 ); |
| 440 |
is( $test[0], -2, 'Patron returned as expired correctly' ); |
| 441 |
|
| 442 |
}; |
| 443 |
|
| 428 |
subtest '_timeout_syspref' => sub { |
444 |
subtest '_timeout_syspref' => sub { |
| 429 |
plan tests => 5; |
445 |
plan tests => 5; |
| 430 |
|
446 |
|