Line 0
Link Here
|
0 |
- |
1 |
#!/usr/bin/perl |
|
|
2 |
|
3 |
# This file is part of Koha. |
4 |
# |
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. |
9 |
# |
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. |
14 |
# |
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>. |
17 |
|
18 |
use Modern::Perl; |
19 |
|
20 |
use Test::More tests => 9; |
21 |
|
22 |
BEGIN { |
23 |
use_ok('C4::SIP::ILS'); |
24 |
} |
25 |
|
26 |
my $class = 'C4::SIP::ILS'; |
27 |
my $institution = { id => 'CPL', }; |
28 |
|
29 |
my $ils = $class->new($institution); |
30 |
|
31 |
isa_ok( $ils, $class ); |
32 |
|
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) |
39 |
); |
40 |
|
41 |
can_ok( $ils, @methods ); |
42 |
|
43 |
is( $ils->institution(), 'CPL', 'institution method returns id' ); |
44 |
|
45 |
is( $ils->institution_id(), 'CPL', 'institution_id method returns id' ); |
46 |
|
47 |
is( $ils->supports('checkout'), 1, 'checkout supported' ); |
48 |
|
49 |
is( $ils->supports('security_inhibit'), |
50 |
q{}, 'unsupported feature returns false' ); |
51 |
|
52 |
is( $ils->test_cardnumber_compare( 'A1234', 'a1234' ), |
53 |
1, 'borrower bc test is case insensitive' ); |
54 |
|
55 |
is( $ils->test_cardnumber_compare( 'A1234', 'b1234' ), |
56 |
q{}, 'borrower bc test identifies difference' ); |