Bugzilla – Attachment 47970 Details for
Bug 15479
SIPserver rejects renewals for patrons with alphanumeric cardnumbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15479 Add tests for ILS.pm
Bug-15479-Add-tests-for-ILSpm.patch (text/plain), 3.33 KB, created by
Kyle M Hall (khall)
on 2016-02-12 13:09:03 UTC
(
hide
)
Description:
Bug 15479 Add tests for ILS.pm
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-02-12 13:09:03 UTC
Size:
3.33 KB
patch
obsolete
>From 5f8d684cafe688488b32ceb8895dac13cf2f7b3c Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Thu, 21 Jan 2016 11:30:31 +0000 >Subject: [PATCH] Bug 15479 Add tests for ILS.pm > >This patch specifically adds a test for the sub added to >resolve Bug 15479. As no test script existed to add this two >added one which also tests that ILS objects can be instantiated >correctly and offer the required interface > >NOTE: This does not apply without the first patch. > Comment #3 suggested a unit test that would fail > before and pass after. So while this code is good, > it missed the before case. -- mtompset > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/SIP/ILS.pm | 7 +++++++ > t/SIPILS.t | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 63 insertions(+) > create mode 100755 t/SIPILS.t > >diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm >index d6117c0..26cd411 100644 >--- a/C4/SIP/ILS.pm >+++ b/C4/SIP/ILS.pm >@@ -180,6 +180,13 @@ sub _ci_cardnumber_cmp { > return ( uc($s1) eq uc($s2) ); > } > >+# wrapper which allows above to be called for testing >+ >+sub test_cardnumber_compare { >+ my ($self, $str1, $str2) = @_; >+ return _ci_cardnumber_cmp($str1, $str2); >+} >+ > sub checkin { > my ( $self, $item_id, $trans_date, $return_date, $current_loc, $item_props, $cancel, $checked_in_ok ) = @_; > my ( $patron, $item, $circ ); >diff --git a/t/SIPILS.t b/t/SIPILS.t >new file mode 100755 >index 0000000..196c9b2 >--- /dev/null >+++ b/t/SIPILS.t >@@ -0,0 +1,56 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 9; >+ >+BEGIN { >+ use_ok('C4::SIP::ILS'); >+} >+ >+my $class = 'C4::SIP::ILS'; >+my $institution = { id => 'CPL', }; >+ >+my $ils = $class->new($institution); >+ >+isa_ok( $ils, $class ); >+ >+# Check all methods required for interface are there >+# NB the mon_block routines are not here but Sip.pm thinks it can call them >+my @methods = ( >+ qw( find_patron find_item checkout_ok checkin_ok offline_ok status_update_ok >+ offline_ok checkout checkin end_patron_session pay_fee add_hold cancel_hold >+ alter_hold renew renew_all) >+); >+ >+can_ok( $ils, @methods ); >+ >+is( $ils->institution(), 'CPL', 'institution method returns id' ); >+ >+is( $ils->institution_id(), 'CPL', 'institution_id method returns id' ); >+ >+is( $ils->supports('checkout'), 1, 'checkout supported' ); >+ >+is( $ils->supports('security_inhibit'), >+ q{}, 'unsupported feature returns false' ); >+ >+is( $ils->test_cardnumber_compare( 'A1234', 'a1234' ), >+ 1, 'borrower bc test is case insensitive' ); >+ >+is( $ils->test_cardnumber_compare( 'A1234', 'b1234' ), >+ q{}, 'borrower bc test identifies difference' ); >-- >2.1.4
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 15479
:
46326
|
47105
|
47811
|
47812
|
47969
| 47970 |
47972