View | Details | Raw Unified | Return to bug 16610
Collapse All | Expand All

(-)a/t/db_dependent/SIP/Message.t (-3 / +24 lines)
Lines 62-68 $branchcode = $branch->{branchcode}; Link Here
62
# START testing
62
# START testing
63
subtest 'Testing Patron Status Request V2' => sub {
63
subtest 'Testing Patron Status Request V2' => sub {
64
    $schema->storage->txn_begin;
64
    $schema->storage->txn_begin;
65
    plan tests => 12;
65
    plan tests => 13;
66
    $C4::SIP::Sip::protocol_version = 2;
66
    $C4::SIP::Sip::protocol_version = 2;
67
    test_request_patron_status_v2();
67
    test_request_patron_status_v2();
68
    $schema->storage->txn_rollback;
68
    $schema->storage->txn_rollback;
Lines 70-76 subtest 'Testing Patron Status Request V2' => sub { Link Here
70
70
71
subtest 'Testing Patron Info Request V2' => sub {
71
subtest 'Testing Patron Info Request V2' => sub {
72
    $schema->storage->txn_begin;
72
    $schema->storage->txn_begin;
73
    plan tests => 15;
73
    plan tests => 16;
74
    $C4::SIP::Sip::protocol_version = 2;
74
    $C4::SIP::Sip::protocol_version = 2;
75
    test_request_patron_info_v2();
75
    test_request_patron_info_v2();
76
    $schema->storage->txn_rollback;
76
    $schema->storage->txn_rollback;
Lines 123-128 sub test_request_patron_status_v2 { Link Here
123
    $respcode = substr( $response, 0, 2 );
123
    $respcode = substr( $response, 0, 2 );
124
    check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'N', 'Verified code CQ for wrong pw' );
124
    check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'N', 'Verified code CQ for wrong pw' );
125
125
126
    # Check empty password and verify CQ again
127
    $siprequest = PATRON_STATUS_REQ. 'engYYYYMMDDZZZZHHMMSS'.
128
        FID_INST_ID. $branchcode. '|'.
129
        FID_PATRON_ID. $card1. '|'.
130
        FID_PATRON_PWD. '|';
131
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
132
    undef $response;
133
    $msg->handle_patron_status( $server );
134
    $respcode = substr( $response, 0, 2 );
135
    check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'N', 'code CQ should be N for empty AD' );
136
126
    # Finally, we send a wrong card number and check AE, BL
137
    # Finally, we send a wrong card number and check AE, BL
127
    # This is done by removing the new patron first
138
    # This is done by removing the new patron first
128
    $schema->resultset('Borrower')->search({ cardnumber => $card1 })->delete;
139
    $schema->resultset('Borrower')->search({ cardnumber => $card1 })->delete;
Lines 175-180 sub test_request_patron_info_v2 { Link Here
175
    # No check for custom fields here (unofficial PB, PC and PI)
186
    # No check for custom fields here (unofficial PB, PC and PI)
176
    check_field( $respcode, $response, FID_SCREEN_MSG, '.+', 'We have a screen msg', 'regex' );
187
    check_field( $respcode, $response, FID_SCREEN_MSG, '.+', 'We have a screen msg', 'regex' );
177
188
189
    # Check empty password and verify CQ again
190
    $siprequest = PATRON_INFO. 'engYYYYMMDDZZZZHHMMSS'.'Y         '.
191
        FID_INST_ID. $branchcode. '|'.
192
        FID_PATRON_ID. $card. '|'.
193
        FID_PATRON_PWD. '|';
194
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
195
    undef $response;
196
    $msg->handle_patron_info( $server );
197
    $respcode = substr( $response, 0, 2 );
198
    check_field( $respcode, $response, FID_VALID_PATRON_PWD, 'N', 'code CQ should be N for empty AD' );
199
178
    # Finally, we send a wrong card number
200
    # Finally, we send a wrong card number
179
    $schema->resultset('Borrower')->search({ cardnumber => $card })->delete;
201
    $schema->resultset('Borrower')->search({ cardnumber => $card })->delete;
180
    undef $findpatron;
202
    undef $findpatron;
181
- 

Return to bug 16610