Bugzilla – Attachment 151633 Details for
Bug 33815
Crash when librarian changes their own username in the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33815: Regression tests
Bug-33815-Regression-tests.patch (text/plain), 1.75 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-05-24 14:55:36 UTC
(
hide
)
Description:
Bug 33815: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-05-24 14:55:36 UTC
Size:
1.75 KB
patch
obsolete
>From 6e9b8d787034473aa586473d4c3c5a1a9fea0d3d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 24 May 2023 11:52:50 -0300 >Subject: [PATCH] Bug 33815: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Auth.t | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index 01aa3575e9f..5c2aad72d41 100755 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -762,7 +762,7 @@ subtest 'check_cookie_auth' => sub { > }; > > subtest 'checkauth & check_cookie_auth' => sub { >- plan tests => 31; >+ plan tests => 35; > > # flags = 4 => { catalogue => 1 } > my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 4 } }); >@@ -824,6 +824,23 @@ subtest 'checkauth & check_cookie_auth' => sub { > is( $auth_status, 'ok' ); > is( $session->id, $first_sessionID ); > >+ my $patron_to_delete = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $fresh_userid = $patron_to_delete->userid; >+ $patron_to_delete->delete; >+ my $old_userid = $patron->userid; >+ >+ # change the current session user's userid >+ $patron->userid( $fresh_userid )->store; >+ ( $auth_status, $session ) = C4::Auth::check_cookie_auth($sessionID, {catalogue => 1}); >+ is( $auth_status, 'expired' ); >+ is( $session, undef ); >+ >+ # restore userid and generate a new session >+ $patron->userid($old_userid)->store; >+ ( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth($cgi, 0, {catalogue => 1}); >+ is( $sessionID, $first_sessionID ); >+ is( $userid, $patron->userid ); >+ > # Logging out! > $cgi->param('logout.x', 1); > $cgi->delete( 'userid', 'password' ); >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33815
:
151609
|
151610
|
151633
|
151634
|
151635
|
151642
|
151643
|
151715
|
151716