Translation updates for Koha 16.05 (beta) release
[koha.git] / C4 / SIP / t / 05block_patron.t
blob474ae9de8e4897196fc13facbc96d7474c854b03
1 #!/usr/bin/perl
2 # block_patron: test Block Patron Response
4 use strict;
5 use warnings;
6 use FindBin qw($Bin);
7 use lib "$Bin";
8 use Clone qw(clone);
10 use C4::SIP::Sip::Constants qw(:all);
12 use SIPtest qw(:basic :user1);
14 my $block_patron_test_template = {
15 id => 'Block Patron: valid patron, card not retained',
16 msg => "01N20060102 084238AO$instid|ALThis card is blocked.|AA$user_barcode|AC$password|",
17 # response to block patron is a patron status message
18 pat => qr/^24Y[ Y]{13}000$datepat/,
19 fields => [
20 $SIPtest::field_specs{(FID_INST_ID)},
21 $SIPtest::field_specs{(FID_SCREEN_MSG)},
22 $SIPtest::field_specs{(FID_PRINT_LINE)},
23 { field => FID_PATRON_ID,
24 pat => qr/^$user_barcode$/o,
25 required => 1, },
26 { field => FID_PERSONAL_NAME,
27 pat => qr/^$user_fullname$/o,
28 required => 1, },
29 { field => FID_VALID_PATRON,
30 pat => qr/^Y$/,
31 # Not required by the spec, but by the test
32 required => 1, },
33 $SIPtest::field_specs{(FID_CURRENCY)},
34 { field => FID_FEE_AMT,
35 pat => $textpat,
36 required => 0, },
37 ], };
39 my @tests = (
40 $SIPtest::login_test,
41 $SIPtest::sc_status_test,
42 clone($block_patron_test_template),
45 SIPtest::run_sip_tests(@tests);