|
Lines 60-66
subtest 'AuthenticatePatron test' => sub {
Link Here
|
| 60 |
} |
60 |
} |
| 61 |
}); |
61 |
}); |
| 62 |
|
62 |
|
| 63 |
my $query = new CGI; |
63 |
my $query = CGI->new; |
| 64 |
$query->param( 'username', $borrower->{userid}); |
64 |
$query->param( 'username', $borrower->{userid}); |
| 65 |
$query->param( 'password', $plain_password); |
65 |
$query->param( 'password', $plain_password); |
| 66 |
|
66 |
|
|
Lines 207-213
subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes
Link Here
|
| 207 |
); |
207 |
); |
| 208 |
|
208 |
|
| 209 |
# Prepare and send web request for IL-SDI server: |
209 |
# Prepare and send web request for IL-SDI server: |
| 210 |
my $query = new CGI; |
210 |
my $query = CGI->new; |
| 211 |
$query->param( 'service', 'GetPatronInfo' ); |
211 |
$query->param( 'service', 'GetPatronInfo' ); |
| 212 |
$query->param( 'patron_id', $brwr->{'borrowernumber'} ); |
212 |
$query->param( 'patron_id', $brwr->{'borrowernumber'} ); |
| 213 |
$query->param( 'show_attributes', '1' ); |
213 |
$query->param( 'show_attributes', '1' ); |
|
Lines 316-322
subtest 'Holds test' => sub {
Link Here
|
| 316 |
} |
316 |
} |
| 317 |
); |
317 |
); |
| 318 |
|
318 |
|
| 319 |
my $query = new CGI; |
319 |
my $query = CGI->new; |
| 320 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
320 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
| 321 |
$query->param( 'bib_id', $item->biblionumber); |
321 |
$query->param( 'bib_id', $item->biblionumber); |
| 322 |
|
322 |
|
|
Lines 339-345
subtest 'Holds test' => sub {
Link Here
|
| 339 |
|
339 |
|
| 340 |
my $biblio_with_no_item = $builder->build_sample_biblio; |
340 |
my $biblio_with_no_item = $builder->build_sample_biblio; |
| 341 |
|
341 |
|
| 342 |
$query = new CGI; |
342 |
$query = CGI->new; |
| 343 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
343 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
| 344 |
$query->param( 'bib_id', $biblio_with_no_item->biblionumber); |
344 |
$query->param( 'bib_id', $biblio_with_no_item->biblionumber); |
| 345 |
|
345 |
|
|
Lines 363-369
subtest 'Holds test' => sub {
Link Here
|
| 363 |
} |
363 |
} |
| 364 |
); |
364 |
); |
| 365 |
|
365 |
|
| 366 |
$query = new CGI; |
366 |
$query = CGI->new; |
| 367 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
367 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
| 368 |
$query->param( 'bib_id', $item2->biblionumber); |
368 |
$query->param( 'bib_id', $item2->biblionumber); |
| 369 |
$query->param( 'item_id', $item2->itemnumber); |
369 |
$query->param( 'item_id', $item2->itemnumber); |
|
Lines 395-401
subtest 'Holds test' => sub {
Link Here
|
| 395 |
} |
395 |
} |
| 396 |
); |
396 |
); |
| 397 |
|
397 |
|
| 398 |
$query = new CGI; |
398 |
$query = CGI->new; |
| 399 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
399 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
| 400 |
$query->param( 'bib_id', $item3->biblionumber); |
400 |
$query->param( 'bib_id', $item3->biblionumber); |
| 401 |
$query->param( 'item_id', $item4->itemnumber); |
401 |
$query->param( 'item_id', $item4->itemnumber); |
|
Lines 459-465
subtest 'Holds test for branch transfer limits' => sub {
Link Here
|
| 459 |
itemtype => $item->effective_itemtype, |
459 |
itemtype => $item->effective_itemtype, |
| 460 |
})->store(); |
460 |
})->store(); |
| 461 |
|
461 |
|
| 462 |
my $query = new CGI; |
462 |
my $query = CGI->new; |
| 463 |
$query->param( 'pickup_location', $pickup_branch->{branchcode} ); |
463 |
$query->param( 'pickup_location', $pickup_branch->{branchcode} ); |
| 464 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
464 |
$query->param( 'patron_id', $patron->{borrowernumber}); |
| 465 |
$query->param( 'bib_id', $item->biblionumber); |
465 |
$query->param( 'bib_id', $item->biblionumber); |
|
Lines 519-525
subtest 'Holds test with start_date and end_date' => sub {
Link Here
|
| 519 |
} |
519 |
} |
| 520 |
); |
520 |
); |
| 521 |
|
521 |
|
| 522 |
my $query = new CGI; |
522 |
my $query = CGI->new; |
| 523 |
$query->param( 'pickup_location', $pickup_library->branchcode ); |
523 |
$query->param( 'pickup_location', $pickup_library->branchcode ); |
| 524 |
$query->param( 'patron_id', $patron->borrowernumber); |
524 |
$query->param( 'patron_id', $patron->borrowernumber); |
| 525 |
$query->param( 'bib_id', $item->biblionumber); |
525 |
$query->param( 'bib_id', $item->biblionumber); |
|
Lines 569-575
subtest 'GetRecords' => sub {
Link Here
|
| 569 |
|
569 |
|
| 570 |
ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode}); |
570 |
ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode}); |
| 571 |
|
571 |
|
| 572 |
my $cgi = new CGI; |
572 |
my $cgi = CGI->new; |
| 573 |
$cgi->param(service => 'GetRecords'); |
573 |
$cgi->param(service => 'GetRecords'); |
| 574 |
$cgi->param(id => $item->biblionumber); |
574 |
$cgi->param(id => $item->biblionumber); |
| 575 |
|
575 |
|
|
Lines 592-598
subtest 'RenewHold' => sub {
Link Here
|
| 592 |
|
592 |
|
| 593 |
$schema->storage->txn_begin; |
593 |
$schema->storage->txn_begin; |
| 594 |
|
594 |
|
| 595 |
my $cgi = new CGI; |
595 |
my $cgi = CGI->new; |
| 596 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
596 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 597 |
my $item = $builder->build_sample_item; |
597 |
my $item = $builder->build_sample_item; |
| 598 |
$cgi->param( patron_id => $patron->borrowernumber ); |
598 |
$cgi->param( patron_id => $patron->borrowernumber ); |
|
Lines 640-646
subtest 'GetPatronInfo paginated loans' => sub {
Link Here
|
| 640 |
branchcode => $library->branchcode, |
640 |
branchcode => $library->branchcode, |
| 641 |
}, |
641 |
}, |
| 642 |
}); |
642 |
}); |
| 643 |
my $module = new Test::MockModule('C4::Context'); |
643 |
my $module = Test::MockModule->new('C4::Context'); |
| 644 |
$module->mock('userenv', sub { { branch => $library->branchcode } }); |
644 |
$module->mock('userenv', sub { { branch => $library->branchcode } }); |
| 645 |
my $date_due = DateTime->now->add(weeks => 2); |
645 |
my $date_due = DateTime->now->add(weeks => 2); |
| 646 |
my $issue1 = C4::Circulation::AddIssue($patron->unblessed, $item1->barcode, $date_due); |
646 |
my $issue1 = C4::Circulation::AddIssue($patron->unblessed, $item1->barcode, $date_due); |
|
Lines 650-656
subtest 'GetPatronInfo paginated loans' => sub {
Link Here
|
| 650 |
my $issue3 = C4::Circulation::AddIssue($patron->unblessed, $item3->barcode, $date_due); |
650 |
my $issue3 = C4::Circulation::AddIssue($patron->unblessed, $item3->barcode, $date_due); |
| 651 |
my $date_due3 = Koha::DateUtils::dt_from_string( $issue3->date_due ); |
651 |
my $date_due3 = Koha::DateUtils::dt_from_string( $issue3->date_due ); |
| 652 |
|
652 |
|
| 653 |
my $cgi = new CGI; |
653 |
my $cgi = CGI->new; |
| 654 |
|
654 |
|
| 655 |
$cgi->param( 'service', 'GetPatronInfo' ); |
655 |
$cgi->param( 'service', 'GetPatronInfo' ); |
| 656 |
$cgi->param( 'patron_id', $patron->borrowernumber ); |
656 |
$cgi->param( 'patron_id', $patron->borrowernumber ); |