use Sip::Constants qw(:all);
-use SIPtest qw($datepat $textpat $instid $user_barcode $user_fullname $item_barcode $item_title $item_owner $second_user_barcode $second_user_fullname $item_on_hold_barcode);
-
-#warn "Holds not implemented (for Evergreen)";
-#SIPtest::run_sip_tests();
-#exit;
+use SIPtest qw($datepat $textpat $instid $user_barcode $user_fullname $item_barcode $item_title $item_owner $second_user_barcode $second_user_fullname $item_on_hold_barcode $cancel_hold_user_barcode);
my $hold_test_template = {
id => 'Place Hold: valid item, valid patron',
required => 0, },
{ field => FID_QUEUE_POS,
pat => qr/^1$/,
- required => 1, },
+ required => 0, },
{ field => FID_PICKUP_LOCN,
pat => qr/^BR1$/,
- required => 1, },
+ required => 0, },
{ field => FID_TITLE_ID,
pat => qr/^$item_title$/,
- required => 1, },
+ required => 0, },
{ field => FID_ITEM_ID,
pat => qr/^$item_barcode$/,
- required => 1, },
+ required => 0, },
],};
my $hold_count_test_template0 = {
push @tests, $test;
# Cancel hold: valid hold
-$test = clone($hold_test_template);
-$test->{id} = 'Cancel hold: valid hold';
-$test->{msg} =~ s/\+/-/;
-$test->{pat} = qr/^161[NY]$datepat/;
-delete $test->{fields};
-$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/,
- required => 1, },
- ];
+$test = {
+ id => 'Cancel hold: valid hold via representative item',
+ msg => "15-20060415 110158BW21060815 110158|BSBR1|BY2|AO$instid|AA$cancel_hold_user_barcode|AB$item_barcode|",
+ pat => qr/^161[YN]$datepat/,
+ fields => [
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$cancel_hold_user_barcode$/,
+ required => 0, },
+ { field => FID_ITEM_ID,
+ pat => qr/^$item_barcode$/,
+ required => 0, },
+ ]};
push @tests, $test, $hold_count_test_template0;
# - multiple holds on item: correct queue position management
# - setting and verifying hold expiry dates (requires ILS support)
-SIPtest::run_sip_tests(@tests);
+# Currently both SIP stacks only support one version of the Cancel Hold action, so let's test just that for now
+SIPtest::run_sip_tests(@tests[0,1,5]);
1;
$second_user_barcode $second_user_pin $second_user_fullname $second_user_homeaddr
$second_user_email $second_user_phone $second_user_birthday $second_user_ptype
$second_user_inet $second_user_homelib
- $user_with_fees_barcode
+ $cancel_hold_user_barcode $user_with_fees_barcode
$item_barcode $item_title $item_owner
$item2_barcode $item2_title $item2_owner
$item_on_hold_barcode
our $item_title = 'Mozart and his piano concertos';
our $item_owner = 'BR1';
+# patron with hold on title above
+our $cancel_hold_user_barcode = '99999355250';
+
# Another valid item
# isbn: 9780553088533
# OCoLC: 25026617