Bugzilla – Attachment 120266 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.76 KB, created by
Nick Clemens (kidclamp)
on 2021-04-28 11:50:53 UTC
(
hide
)
Description:
Bug 27600: Add unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-04-28 11:50:53 UTC
Size:
1.76 KB
patch
obsolete
>From 49613cd0bb44edd7c75b434c19e09cd0651e84c7 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. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > 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.11.0
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