Lines 35-40
my $dbh = C4::Context->dbh;
Link Here
|
35 |
t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); |
35 |
t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); |
36 |
t::lib::Mocks::mock_preference( 'GDPR_Policy', '' ); # Disabled |
36 |
t::lib::Mocks::mock_preference( 'GDPR_Policy', '' ); # Disabled |
37 |
|
37 |
|
|
|
38 |
# To silence useless warnings |
39 |
$ENV{REMOTE_ADDR} = '127.0.0.1'; |
40 |
|
38 |
$schema->storage->txn_begin; |
41 |
$schema->storage->txn_begin; |
39 |
|
42 |
|
40 |
subtest 'checkauth() tests' => sub { |
43 |
subtest 'checkauth() tests' => sub { |
Lines 148-154
subtest 'checkauth() tests' => sub {
Link Here
|
148 |
} |
151 |
} |
149 |
|
152 |
|
150 |
t::lib::Mocks::mock_preference( 'TwoFactorAuthentication', 0 ); |
153 |
t::lib::Mocks::mock_preference( 'TwoFactorAuthentication', 0 ); |
151 |
$patron->secret('one_secret'); |
154 |
$patron->encode_secret('one_secret'); |
152 |
$patron->auth_method('password'); |
155 |
$patron->auth_method('password'); |
153 |
$patron->store; |
156 |
$patron->store; |
154 |
( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired', undef, 'intranet' ); |
157 |
( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired', undef, 'intranet' ); |
Lines 509-515
subtest 'Check value of login_attempts in checkpw' => sub {
Link Here
|
509 |
}; |
512 |
}; |
510 |
|
513 |
|
511 |
subtest '_timeout_syspref' => sub { |
514 |
subtest '_timeout_syspref' => sub { |
512 |
plan tests => 5; |
515 |
|
|
|
516 |
plan tests => 6; |
513 |
|
517 |
|
514 |
t::lib::Mocks::mock_preference('timeout', "100"); |
518 |
t::lib::Mocks::mock_preference('timeout', "100"); |
515 |
is( C4::Auth::_timeout_syspref, 100, ); |
519 |
is( C4::Auth::_timeout_syspref, 100, ); |
Lines 524-530
subtest '_timeout_syspref' => sub {
Link Here
|
524 |
is( C4::Auth::_timeout_syspref, 10*3600, ); |
528 |
is( C4::Auth::_timeout_syspref, 10*3600, ); |
525 |
|
529 |
|
526 |
t::lib::Mocks::mock_preference('timeout', "10x"); |
530 |
t::lib::Mocks::mock_preference('timeout', "10x"); |
527 |
is( C4::Auth::_timeout_syspref, 600, ); |
531 |
warning_is |
|
|
532 |
{ is( C4::Auth::_timeout_syspref, 600, ); } |
533 |
"The value of the system preference 'timeout' is not correct, defaulting to 600", |
534 |
'Bad values throw a warning and fallback to 600'; |
528 |
}; |
535 |
}; |
529 |
|
536 |
|
530 |
subtest 'check_cookie_auth' => sub { |
537 |
subtest 'check_cookie_auth' => sub { |
531 |
- |
|
|