|
Lines 54-60
C4::Context->set_userenv(@USERENV);
Link Here
|
| 54 |
BAIL_OUT("No userenv") unless C4::Context->userenv; |
54 |
BAIL_OUT("No userenv") unless C4::Context->userenv; |
| 55 |
|
55 |
|
| 56 |
|
56 |
|
| 57 |
# wantsCheckPrevCheckout |
57 |
# wants_check_for_previous_checkout |
| 58 |
|
58 |
|
| 59 |
# We expect the following result matrix: |
59 |
# We expect the following result matrix: |
| 60 |
# |
60 |
# |
|
Lines 203-209
map {
Link Here
|
| 203 |
}); |
203 |
}); |
| 204 |
my $patron = Koha::Patrons->find($kpatron->{borrowernumber}); |
204 |
my $patron = Koha::Patrons->find($kpatron->{borrowernumber}); |
| 205 |
is( |
205 |
is( |
| 206 |
$patron->wantsCheckPrevCheckout, $_->{result}, |
206 |
$patron->wants_check_for_previous_checkout, $_->{result}, |
| 207 |
"Predicate with syspref " . $syspref . ", cat " . $code |
207 |
"Predicate with syspref " . $syspref . ", cat " . $code |
| 208 |
. ", patron " . $_->{setting} |
208 |
. ", patron " . $_->{setting} |
| 209 |
); |
209 |
); |
|
Lines 211-217
map {
Link Here
|
| 211 |
} @{$_->{categories}}; |
211 |
} @{$_->{categories}}; |
| 212 |
} @{$mappings}; |
212 |
} @{$mappings}; |
| 213 |
|
213 |
|
| 214 |
# doCheckPrevCheckout |
214 |
# do_check_for_previous_checkout |
| 215 |
|
215 |
|
| 216 |
# We want to test: |
216 |
# We want to test: |
| 217 |
# - DESCRIPTION [RETURNVALUE (0/1)] |
217 |
# - DESCRIPTION [RETURNVALUE (0/1)] |
|
Lines 254-260
sub test_it {
Link Here
|
| 254 |
map { |
254 |
map { |
| 255 |
my $patron = Koha::Patrons->find($_->{patron}->{borrowernumber}); |
255 |
my $patron = Koha::Patrons->find($_->{patron}->{borrowernumber}); |
| 256 |
is( |
256 |
is( |
| 257 |
$patron->doCheckPrevCheckout($_->{item}), |
257 |
$patron->do_check_for_previous_checkout($_->{item}), |
| 258 |
$_->{result}, $stage . ": " . $_->{msg} |
258 |
$_->{result}, $stage . ": " . $_->{msg} |
| 259 |
); |
259 |
); |
| 260 |
} @{$mapping}; |
260 |
} @{$mapping}; |
|
Lines 358-377
test_it($cpvPmappings, "PostReturn");
Link Here
|
| 358 |
|
358 |
|
| 359 |
# Finally test C4::Circulation::CanBookBeIssued |
359 |
# Finally test C4::Circulation::CanBookBeIssued |
| 360 |
|
360 |
|
| 361 |
# We have already tested ->wantsCheckPrevCheckout and ->doCheckPrevCheckout, |
361 |
# We have already tested ->wants_check_for_previous_checkout and |
| 362 |
# so all that remains to be tested is whetherthe different combinational |
362 |
# ->do_check_for_previous_checkout, so all that remains to be tested is |
| 363 |
# outcomes of the above return values in CanBookBeIssued result in the |
363 |
# whetherthe different combinational outcomes of the above return values in |
| 364 |
# approriate $needsconfirmation. |
364 |
# CanBookBeIssued result in the approriate $needsconfirmation. |
| 365 |
|
365 |
|
| 366 |
# We want to test: |
366 |
# We want to test: |
| 367 |
# - DESCRIPTION [RETURNVALUE (0/1)] |
367 |
# - DESCRIPTION [RETURNVALUE (0/1)] |
| 368 |
# - patron, !wantsCheckPrevCheckout, !doCheckPrevCheckout |
368 |
# - patron, !wants_check_for_previous_checkout, !do_check_for_previous_checkout |
| 369 |
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}] |
369 |
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}] |
| 370 |
# - patron, wantsCheckPrevCheckout, !doCheckPrevCheckout |
370 |
# - patron, wants_check_for_previous_checkout, !do_check_for_previous_checkout |
| 371 |
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}] |
371 |
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}] |
| 372 |
# - patron, !wantsCheckPrevCheckout, doCheckPrevCheckout |
372 |
# - patron, !wants_check_for_previous_checkout, do_check_for_previous_checkout |
| 373 |
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}] |
373 |
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}] |
| 374 |
# - patron, wantsCheckPrevCheckout, doCheckPrevCheckout |
374 |
# - patron, wants_check_for_previous_checkout, do_check_for_previous_checkout |
| 375 |
# [!$issuingimpossible,$needsconfirmation->{PREVISSUE}] |
375 |
# [!$issuingimpossible,$needsconfirmation->{PREVISSUE}] |
| 376 |
|
376 |
|
| 377 |
# Needs: |
377 |
# Needs: |
|
Lines 410-435
my $CBBI_mappings = [
Link Here
|
| 410 |
syspref => 'hardno', |
410 |
syspref => 'hardno', |
| 411 |
item => $new_item, |
411 |
item => $new_item, |
| 412 |
result => undef, |
412 |
result => undef, |
| 413 |
msg => "patron, !wantsCheckPrevCheckout, !doCheckPrevCheckout" |
413 |
msg => "patron, !wants_check_for_previous_checkout, !do_check_for_previous_checkout" |
| 414 |
|
414 |
|
| 415 |
}, |
415 |
}, |
| 416 |
{ |
416 |
{ |
| 417 |
syspref => 'hardyes', |
417 |
syspref => 'hardyes', |
| 418 |
item => $new_item, |
418 |
item => $new_item, |
| 419 |
result => undef, |
419 |
result => undef, |
| 420 |
msg => "patron, wantsCheckPrevCheckout, !doCheckPrevCheckout" |
420 |
msg => "patron, wants_check_for_previous_checkout, !do_check_for_previous_checkout" |
| 421 |
}, |
421 |
}, |
| 422 |
{ |
422 |
{ |
| 423 |
syspref => 'hardno', |
423 |
syspref => 'hardno', |
| 424 |
item => $prev_item, |
424 |
item => $prev_item, |
| 425 |
result => undef, |
425 |
result => undef, |
| 426 |
msg => "patron, !wantsCheckPrevCheckout, doCheckPrevCheckout" |
426 |
msg => "patron, !wants_check_for_previous_checkout, do_check_for_previous_checkout" |
| 427 |
}, |
427 |
}, |
| 428 |
{ |
428 |
{ |
| 429 |
syspref => 'hardyes', |
429 |
syspref => 'hardyes', |
| 430 |
item => $prev_item, |
430 |
item => $prev_item, |
| 431 |
result => 1, |
431 |
result => 1, |
| 432 |
msg => "patron, wantsCheckPrevCheckout, doCheckPrevCheckout" |
432 |
msg => "patron, wants_check_for_previous_checkout, do_check_for_previous_checkout" |
| 433 |
}, |
433 |
}, |
| 434 |
]; |
434 |
]; |
| 435 |
|
435 |
|
| 436 |
- |
|
|