Lines 108-114
subtest 'checkauth() tests' => sub {
Link Here
|
108 |
is( $userid, undef, 'If librarian user is used and password with GET, they should not be logged in' ); |
108 |
is( $userid, undef, 'If librarian user is used and password with GET, they should not be logged in' ); |
109 |
}; |
109 |
}; |
110 |
|
110 |
|
111 |
C4::Context->_new_userenv; # For next tests |
111 |
C4::Context->new_userenv; # For next tests |
112 |
|
112 |
|
113 |
}; |
113 |
}; |
114 |
|
114 |
|
Lines 167-173
subtest 'no_set_userenv parameter tests' => sub {
Link Here
|
167 |
|
167 |
|
168 |
ok( checkpw( $dbh, $patron->userid, $password, undef, undef, 1 ), 'checkpw returns true' ); |
168 |
ok( checkpw( $dbh, $patron->userid, $password, undef, undef, 1 ), 'checkpw returns true' ); |
169 |
is( C4::Context->userenv, undef, 'Userenv should be undef as required' ); |
169 |
is( C4::Context->userenv, undef, 'Userenv should be undef as required' ); |
170 |
C4::Context->_new_userenv('DUMMY SESSION'); |
170 |
C4::Context->new_userenv('DUMMY SESSION'); |
171 |
C4::Context->set_userenv(0,0,0,'firstname','surname', $library->branchcode, 'Library 1', 0, '', ''); |
171 |
C4::Context->set_userenv(0,0,0,'firstname','surname', $library->branchcode, 'Library 1', 0, '', ''); |
172 |
is( C4::Context->userenv->{branch}, $library->branchcode, 'Userenv gives correct branch' ); |
172 |
is( C4::Context->userenv->{branch}, $library->branchcode, 'Userenv gives correct branch' ); |
173 |
ok( checkpw( $dbh, $patron->userid, $password, undef, undef, 1 ), 'checkpw returns true' ); |
173 |
ok( checkpw( $dbh, $patron->userid, $password, undef, undef, 1 ), 'checkpw returns true' ); |
Lines 641-647
subtest 'Userenv clearing in check_cookie_auth' => sub {
Link Here
|
641 |
is( C4::Context->userenv, undef, 'Environment should be cleared too' ); |
641 |
is( C4::Context->userenv, undef, 'Environment should be cleared too' ); |
642 |
|
642 |
|
643 |
# Show that we clear the userenv again: set up env and check deleted session |
643 |
# Show that we clear the userenv again: set up env and check deleted session |
644 |
C4::Context->_new_userenv( $sessionID ); |
644 |
C4::Context->new_userenv( $sessionID ); |
645 |
C4::Context->set_userenv; # empty |
645 |
C4::Context->set_userenv; # empty |
646 |
is( defined C4::Context->userenv, 1, 'There should be an empty userenv again' ); |
646 |
is( defined C4::Context->userenv, 1, 'There should be an empty userenv again' ); |
647 |
( $auth_status, $session) = C4::Auth::check_cookie_auth( $sessionID ); |
647 |
( $auth_status, $session) = C4::Auth::check_cookie_auth( $sessionID ); |