Bugzilla – Attachment 162529 Details for
Bug 36034
cas_ticket is set to serialized patron object in session
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36034: [22.05] Add test
Bug-36034-Add-test.patch (text/plain), 2.13 KB, created by
Jonathan Druart
on 2024-02-28 07:52:29 UTC
(
hide
)
Description:
Bug 36034: [22.05] Add test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-02-28 07:52:29 UTC
Size:
2.13 KB
patch
obsolete
>From 6f5e263197d97b762868fbc544afe5455063703a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 14 Feb 2024 08:49:33 +0100 >Subject: [PATCH] Bug 36034: Add test > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Auth.t | 31 ++++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index d53b3364f91..6a938661292 100755 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -42,7 +42,7 @@ $schema->storage->txn_begin; > > subtest 'checkauth() tests' => sub { > >- plan tests => 9; >+ plan tests => 10; > > my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => undef } }); > >@@ -136,6 +136,35 @@ subtest 'checkauth() tests' => sub { > }; > }; > >+ subtest 'cas_ticket must be empty in session' => sub { >+ >+ plan tests => 2; >+ >+ my $patron = $builder->build_object( >+ { class => 'Koha::Patrons', value => { flags => 1 } } ); >+ my $password = 'password'; >+ t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); >+ $patron->set_password( { password => $password } ); >+ $cgi = Test::MockObject->new(); >+ $cgi->mock( 'cookie', sub { return; } ); >+ $cgi->mock( >+ 'param', >+ sub { >+ my ( $self, $param ) = @_; >+ if ( $param eq 'userid' ) { return $patron->userid; } >+ elsif ( $param eq 'password' ) { return $password; } >+ else { return; } >+ } >+ ); >+ >+ $cgi->mock( 'request_method', sub { return 'POST' } ); >+ ( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired' ); >+ is( $userid, $patron->userid, 'If librarian user is used and password with POST, they should be logged in' ); >+ my $session = C4::Auth::get_session($sessionID); >+ is( $session->param('cas_ticket'), undef ); >+ >+ }; >+ > subtest 'Template params tests (password_expired)' => sub { > > plan tests => 1; >-- >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 36034
:
161888
|
161926
|
162130
|
162131
|
162132
| 162529