Bugzilla – Attachment 159356 Details for
Bug 34893
ILS-DI can return the wrong patron for AuthenticatePatron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34893: Add unit tests
Bug-34893-Add-unit-tests.patch (text/plain), 2.20 KB, created by
Kyle M Hall (khall)
on 2023-11-29 17:22:07 UTC
(
hide
)
Description:
Bug 34893: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-11-29 17:22:07 UTC
Size:
2.20 KB
patch
obsolete
>From fbc19006513a6f2cb966668b38911c819769fe62 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 29 Nov 2023 17:18:32 +0000 >Subject: [PATCH] Bug 34893: Add unit tests > >--- > t/db_dependent/ILSDI_Services.t | 49 ++++++++++++++++++++++++++++++++- > 1 file changed, 48 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index 7d22071c439..9fb01180a42 100755 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -19,7 +19,7 @@ use Modern::Perl; > > use CGI qw ( -utf8 ); > >-use Test::More tests => 13; >+use Test::More tests => 14; > use Test::MockModule; > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -1043,3 +1043,50 @@ subtest 'GetAvailability itemcallnumber' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $plain_password = 'tomasito'; >+ >+ $builder->build({ >+ source => 'Borrower', >+ value => { >+ cardnumber => undef, >+ } >+ }); >+ >+ my $borrower0 = $builder->build({ >+ source => 'Borrower', >+ value => { >+ cardnumber => "cardnumber1", >+ userid => undef, >+ password => Koha::AuthUtils::hash_password( $plain_password ), >+ lastseen => "2001-01-01 12:34:56" >+ } >+ }); >+ >+ my $borrower = $builder->build({ >+ source => 'Borrower', >+ value => { >+ cardnumber => "cardnumber2", >+ userid => undef, >+ password => Koha::AuthUtils::hash_password( $plain_password ), >+ lastseen => "2001-01-01 12:34:56" >+ } >+ }); >+ >+ my $query = CGI->new; >+ $query->param( 'username', $borrower->{cardnumber}); >+ $query->param( 'password', $plain_password); >+ >+ my $reply = C4::ILSDI::Services::AuthenticatePatron( $query ); >+ is( $reply->{id}, $borrower->{borrowernumber}, "userid and password - Patron authenticated" ); >+ is( $reply->{code}, undef, "Error code undef"); >+ my $seen_patron = Koha::Patrons->find({ borrowernumber => $reply->{id} }); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.30.2
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 34893
:
156121
|
156123
|
159311
|
159314
|
159315
|
159356
|
159441
|
159506
|
159507
|
159508
|
159509
|
159797
|
159798
|
159799
|
159800
|
159893
|
161097
|
161098
|
161099
|
161100
|
161101
|
161324
|
163964