Bug 17781 - Improper branchcode set during renewal
[koha.git] / t / db_dependent / SIP / ILS.t
blob77eafa20b125d911dd2e1d4252eba1d709f6cf02
1 #!/usr/bin/perl
3 # Tests for C4::SIP::ILS
4 # Please help to extend them!
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # Koha is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Koha; if not, see <http://www.gnu.org/licenses>.
21 use Modern::Perl;
23 use Test::More tests => 9;
25 BEGIN {
26 use_ok('C4::SIP::ILS');
29 my $class = 'C4::SIP::ILS';
30 my $institution = { id => 'CPL', };
32 my $ils = $class->new( $institution );
34 isa_ok( $ils, $class );
36 # Check all methods required for interface are there
37 my @methods = qw(
38 find_patron find_item checkout_ok checkin_ok offline_ok status_update_ok
39 offline_ok checkout checkin end_patron_session pay_fee add_hold cancel_hold
40 alter_hold renew renew_all
43 can_ok( $ils, @methods );
45 is( $ils->institution(), 'CPL', 'institution method returns id' );
47 is( $ils->institution_id(), 'CPL', 'institution_id method returns id' );
49 is( $ils->supports('checkout'), 1, 'checkout supported' );
51 is( $ils->supports('security_inhibit'),
52 q{}, 'unsupported feature returns false' );
54 is( $ils->test_cardnumber_compare( 'A1234', 'a1234' ),
55 1, 'borrower bc test is case insensitive' );
57 is( $ils->test_cardnumber_compare( 'A1234', 'b1234' ),
58 q{}, 'borrower bc test identifies difference' );