Changing CanBookBeRenewed to pass back the reason a renewal cannot proceed
[koha.git] / C4 / SIP / t / 11item_info.t
1 #!/usr/bin/perl
2 # renew_all: test Renew All Response
3
4 use strict;
5 use warnings;
6 use Clone qw(clone);
7
8 use Sip::Constants qw(:all);
9
10 use SIPtest qw($datepat $textpat $instid $currency $user_barcode
11                $item_barcode $item_title $item_owner);
12
13 my $item_info_test_template = {
14     id => 'Item Information: check information for available item',
15     msg => "1720060110    215612AO$instid|AB$item_barcode|",
16     pat => qr/^180[13]0201$datepat/, # status of 'other' or 'available'
17     fields => [
18                $SIPtest::field_specs{(FID_SCREEN_MSG)},
19                $SIPtest::field_specs{(FID_PRINT_LINE)},
20                { field    => FID_ITEM_ID,
21                  pat      => qr/^$item_barcode$/,
22                  required => 1, },
23                { field    => FID_TITLE_ID,
24                  pat      => qr/^$item_title\s*$/,
25                  required => 1, },
26                { field    => FID_MEDIA_TYPE,
27                  pat      => qr/^\d{3}$/,
28                  required => 0, },
29                { field    => FID_OWNER,
30                  pat      => qr/^$item_owner$/,
31                  required => 0, },
32                ], };
33
34 my @tests = (
35              $SIPtest::login_test,
36              $SIPtest::sc_status_test,
37              clone($item_info_test_template),
38              );
39
40 SIPtest::run_sip_tests(@tests);
41
42 1;