use Sip::Constants qw(:all);
use SIPtest qw($datepat $textpat $instid $currency $user_barcode $user_pin
- $user_fullname $user_homeaddr $user_email $user_phone
- $user_birthday $user_ptype $user_inet $user_homelib);
+ $user_fullname $user_homeaddr $user_email $user_phone
+ $user_birthday $user_ptype $user_inet $user_homelib
+ $item_barcode $item_title $item_owner);
my $patron_info_test_template = {
id => 'valid Patron Info no details',
]
};
+my $item_info_test_template = {
+ id => 'Item Information: check information for available item',
+ msg => "1720060110 215612AO$instid|AB$item_barcode|",
+ pat => qr/^180[139]0201$datepat/, # status of 'other' or 'available'
+ fields => [
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_ITEM_ID,
+ pat => qr/^$item_barcode$/,
+ required => 1, },
+ { field => FID_TITLE_ID,
+ pat => qr/^$item_title\s*$/,
+ required => 1, },
+ { field => FID_MEDIA_TYPE,
+ pat => qr/^\d{3}$/,
+ required => 0, },
+ { field => FID_OWNER,
+ pat => qr/^$item_owner$/,
+ required => 0, },
+], };
+
my @tests = (
$SIPtest::login_test,
$SIPtest::sc_status_test,
clone($patron_info_test_template),
clone($patron_status_test_template),
+ clone($item_info_test_template),
);
}
+sub create_ils_defined_protocol_extension_tests {
+
+ # in Evergreen, these are the SIP Field entries with stat cats
+
+ my $test = clone($patron_info_test_template);
+ $test->{id} = "Patron Info ILS defined extension";
+ push @{$test->{fields}}, {
+ field => 'XX',
+ pat => qr/^abc$/o,
+ just_warn => 1, required => 1, };
+ push @tests, $test;
+
+ $test = clone($item_info_test_template);
+ $test->{id} = "Item Info ILS defined extension";
+ push @{$test->{fields}}, {
+ field => 'YY',
+ pat => qr/^b1$/o,
+ just_warn => 1, required => 1, };
+ push @tests, $test;
+
+}
+
create_patron_info_extension_tests();
create_patron_status_extension_tests();
+create_ils_defined_protocol_extension_tests();
SIPtest::run_sip_tests(@tests);
where
name = 'sip.sc_status_before_login_institution'
;
+
+INSERT INTO actor.stat_cat_sip_field (field, name, one_only) VALUES ('XX', 'Generic Unformatted Export', 'f');
+INSERT INTO asset.stat_cat_sip_field (field, name, one_only) VALUES ('YY', 'Generic Unformatted Export', 'f');
+
+INSERT INTO actor.stat_cat (owner, name, opac_visible, usr_summary, sip_field, sip_format, checkout_archive, required, allow_freetext)
+ VALUES (1, 'test', 'f', 'f', 'XX', '', 'f', 'f', 't');
+INSERT INTO actor.stat_cat_entry_usr_map (stat_cat_entry, stat_cat, target_usr)
+ VALUES ('abc', 1, 71);
+
+INSERT INTO asset.stat_cat (owner, opac_visible, name, required, sip_field, checkout_archive)
+ VALUES (1, 'f', 'test', 'f', 'YY', '', 'f');
+INSERT INTO asset.stat_cat_entry(stat_cat, owner, value)
+ VALUES (1, 1, 'a1'), (1, 1, 'b1');
+INSERT INTO asset.stat_cat_entry_copy_map (stat_cat, stat_cat_entry, owning_copy)
+ VALUES (1, 2, 2003);
+
+