Bugzilla – Attachment 116245 Details for
Bug 27600
SIP2: renew_all shouldn't perform a password check
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27600: Add unit test
Bug-27600-Add-unit-test.patch (text/plain), 1.71 KB, created by
Martin Renvoize (ashimema)
on 2021-02-03 10:18:20 UTC
(
hide
)
Description:
Bug 27600: Add unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-02-03 10:18:20 UTC
Size:
1.71 KB
patch
obsolete
>From cfb54d318d11da5c77482a530ccf46b077c26229 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 3 Feb 2021 10:16:30 +0000 >Subject: [PATCH] Bug 27600: Add unit test > >This patch adds a basic unit test to catch the case where patron_pwd is >sent to renew_all as an empty string. > >Test plan >1/ Run t/db_dependent/SIP/ILS.t and watch it fail >2/ Apply second patch >3/ Re-run the above test and watch it pass. >--- > t/db_dependent/SIP/ILS.t | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/ILS.t b/t/db_dependent/SIP/ILS.t >index 99c0df2147..f39fb28b11 100755 >--- a/t/db_dependent/SIP/ILS.t >+++ b/t/db_dependent/SIP/ILS.t >@@ -20,7 +20,7 @@ > > use Modern::Perl; > >-use Test::More tests => 11; >+use Test::More tests => 12; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -174,4 +174,25 @@ subtest checkout => sub { > is( $checkout->renewals, 1, "Renewals has been reduced"); > }; > >+subtest renew_all => sub { >+ plan tests => 1; >+ >+ my $library = $builder->build_object ({ class => 'Koha::Libraries' }); >+ my $patron = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { >+ branchcode => $library->branchcode, >+ } >+ } >+ ); >+ t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode, flags => 1 }); >+ >+ my $ils = C4::SIP::ILS->new({ id => $library->branchcode }); >+ >+ # Send empty AD segments (i.e. empty string for patron_pwd) >+ my $transaction = $ils->renew_all( $patron->cardnumber, "", undef ); >+ isnt( $transaction->{screen_msg}, 'Invalid patron password.', "Empty password succeeds" ); >+}; >+ > $schema->storage->txn_rollback; >-- >2.20.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 27600
:
116243
|
116245
|
116246
|
120266
|
120267
|
120796
|
120797
|
120798
|
120799
|
120829
|
120830