Translation for 3.20.11
[koha.git] / t / SIPILS.t
blob196c9b2e0e5adef4ea6a3966edb5561d9ee3d8a4
1 #!/usr/bin/perl
3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
18 use Modern::Perl;
20 use Test::More tests => 9;
22 BEGIN {
23 use_ok('C4::SIP::ILS');
26 my $class = 'C4::SIP::ILS';
27 my $institution = { id => 'CPL', };
29 my $ils = $class->new($institution);
31 isa_ok( $ils, $class );
33 # Check all methods required for interface are there
34 # NB the mon_block routines are not here but Sip.pm thinks it can call them
35 my @methods = (
36 qw( find_patron find_item checkout_ok checkin_ok offline_ok status_update_ok
37 offline_ok checkout checkin end_patron_session pay_fee add_hold cancel_hold
38 alter_hold renew renew_all)
41 can_ok( $ils, @methods );
43 is( $ils->institution(), 'CPL', 'institution method returns id' );
45 is( $ils->institution_id(), 'CPL', 'institution_id method returns id' );
47 is( $ils->supports('checkout'), 1, 'checkout supported' );
49 is( $ils->supports('security_inhibit'),
50 q{}, 'unsupported feature returns false' );
52 is( $ils->test_cardnumber_compare( 'A1234', 'a1234' ),
53 1, 'borrower bc test is case insensitive' );
55 is( $ils->test_cardnumber_compare( 'A1234', 'b1234' ),
56 q{}, 'borrower bc test identifies difference' );