Lines 41-47
$schema->storage->txn_begin;
Link Here
|
41 |
|
41 |
|
42 |
subtest 'checkauth() tests' => sub { |
42 |
subtest 'checkauth() tests' => sub { |
43 |
|
43 |
|
44 |
plan tests => 9; |
44 |
plan tests => 10; |
45 |
|
45 |
|
46 |
my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => undef } }); |
46 |
my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => undef } }); |
47 |
|
47 |
|
Lines 111-116
subtest 'checkauth() tests' => sub {
Link Here
|
111 |
is( $userid, undef, 'If librarian user is used and password with GET, they should not be logged in' ); |
111 |
is( $userid, undef, 'If librarian user is used and password with GET, they should not be logged in' ); |
112 |
}; |
112 |
}; |
113 |
|
113 |
|
|
|
114 |
subtest 'cas_ticket must be empty in session' => sub { |
115 |
|
116 |
plan tests => 2; |
117 |
|
118 |
my $patron = $builder->build_object( |
119 |
{ class => 'Koha::Patrons', value => { flags => 1 } } ); |
120 |
my $password = 'password'; |
121 |
t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); |
122 |
$patron->set_password( { password => $password } ); |
123 |
$cgi = Test::MockObject->new(); |
124 |
$cgi->mock( 'cookie', sub { return; } ); |
125 |
$cgi->mock( |
126 |
'param', |
127 |
sub { |
128 |
my ( $self, $param ) = @_; |
129 |
if ( $param eq 'userid' ) { return $patron->userid; } |
130 |
elsif ( $param eq 'password' ) { return $password; } |
131 |
else { return; } |
132 |
} |
133 |
); |
134 |
|
135 |
$cgi->mock( 'request_method', sub { return 'POST' } ); |
136 |
( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired' ); |
137 |
is( $userid, $patron->userid, 'If librarian user is used and password with POST, they should be logged in' ); |
138 |
my $session = C4::Auth::get_session($sessionID); |
139 |
is( $session->param('cas_ticket'), undef ); |
140 |
|
141 |
}; |
142 |
|
143 |
|
114 |
subtest 'Template params tests (password_expired)' => sub { |
144 |
subtest 'Template params tests (password_expired)' => sub { |
115 |
|
145 |
|
116 |
plan tests => 1; |
146 |
plan tests => 1; |
117 |
- |
|
|