|
Lines 64-70
subtest 'Testing Patron Status Request V2' => sub {
Link Here
|
| 64 |
subtest 'Testing Patron Info Request V2' => sub { |
64 |
subtest 'Testing Patron Info Request V2' => sub { |
| 65 |
my $schema = Koha::Database->new->schema; |
65 |
my $schema = Koha::Database->new->schema; |
| 66 |
$schema->storage->txn_begin; |
66 |
$schema->storage->txn_begin; |
| 67 |
plan tests => 32; |
67 |
plan tests => 35; |
| 68 |
$C4::SIP::Sip::protocol_version = 2; |
68 |
$C4::SIP::Sip::protocol_version = 2; |
| 69 |
test_request_patron_info_v2(); |
69 |
test_request_patron_info_v2(); |
| 70 |
$schema->storage->txn_rollback; |
70 |
$schema->storage->txn_rollback; |
|
Lines 1070-1077
sub test_request_patron_status_v2 {
Link Here
|
| 1070 |
} |
1070 |
} |
| 1071 |
|
1071 |
|
| 1072 |
sub test_request_patron_info_v2 { |
1072 |
sub test_request_patron_info_v2 { |
| 1073 |
my $builder = t::lib::TestBuilder->new(); |
1073 |
my $builder = t::lib::TestBuilder->new(); |
| 1074 |
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode}; |
1074 |
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode}; |
|
|
1075 |
my $branchcode2 = $builder->build( { source => 'Branch' } )->{branchcode}; |
| 1075 |
my ( $response, $findpatron ); |
1076 |
my ( $response, $findpatron ); |
| 1076 |
my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); |
1077 |
my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); |
| 1077 |
|
1078 |
|
|
Lines 1079-1091
sub test_request_patron_info_v2 {
Link Here
|
| 1079 |
{ |
1080 |
{ |
| 1080 |
source => 'Borrower', |
1081 |
source => 'Borrower', |
| 1081 |
value => { |
1082 |
value => { |
| 1082 |
password => hash_password(PATRON_PW), |
1083 |
password => hash_password(PATRON_PW), |
|
|
1084 |
branchcode => $branchcode2, |
| 1083 |
}, |
1085 |
}, |
| 1084 |
} |
1086 |
} |
| 1085 |
); |
1087 |
); |
| 1086 |
my $card = $patron2->{cardnumber}; |
1088 |
my $card = $patron2->{cardnumber}; |
| 1087 |
my $sip_patron2 = C4::SIP::ILS::Patron->new($card); |
1089 |
my $sip_patron2 = C4::SIP::ILS::Patron->new($card); |
| 1088 |
$findpatron = $sip_patron2; |
1090 |
$findpatron = $sip_patron2; |
|
|
1091 |
|
| 1089 |
my $siprequest = |
1092 |
my $siprequest = |
| 1090 |
PATRON_INFO |
1093 |
PATRON_INFO |
| 1091 |
. 'engYYYYMMDDZZZZHHMMSS' |
1094 |
. 'engYYYYMMDDZZZZHHMMSS' |
|
Lines 1130-1135
sub test_request_patron_info_v2 {
Link Here
|
| 1130 |
'Check customized patron name' |
1133 |
'Check customized patron name' |
| 1131 |
); |
1134 |
); |
| 1132 |
|
1135 |
|
|
|
1136 |
# Test patron_branchcode_in_ao |
| 1137 |
$server->{account}->{patron_branchcode_in_ao} = "1"; |
| 1138 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
| 1139 |
undef $response; |
| 1140 |
is( $patron2->{branchcode}, $branchcode2, "Patron created with correct home library" ); |
| 1141 |
is( $sip_patron2->branchcode, $branchcode2, "SIP Patron created with correct home library" ); |
| 1142 |
$msg->handle_patron_info($server); |
| 1143 |
$respcode = substr( $response, 0, 2 ); |
| 1144 |
check_field( |
| 1145 |
$respcode, $response, FID_INST_ID, $patron2->{branchcode}, |
| 1146 |
"Patron home library is in the AO field( patron = $patron2->{branchcode}, INST = $branchcode" |
| 1147 |
); |
| 1148 |
|
| 1133 |
# Test hide_fields |
1149 |
# Test hide_fields |
| 1134 |
undef $response; |
1150 |
undef $response; |
| 1135 |
$server->{account}->{hide_fields} = join( ",", FID_HOME_ADDR, FID_EMAIL, FID_HOME_PHONE, FID_PATRON_BIRTHDATE ); |
1151 |
$server->{account}->{hide_fields} = join( ",", FID_HOME_ADDR, FID_EMAIL, FID_HOME_PHONE, FID_PATRON_BIRTHDATE ); |
| 1136 |
- |
|
|