|
Lines 558-564
subtest 'add_enrolment_fee_if_needed' => sub {
Link Here
|
| 558 |
$patron->delete; |
558 |
$patron->delete; |
| 559 |
}; |
559 |
}; |
| 560 |
|
560 |
|
| 561 |
subtest 'checkouts + pending_checkouts + get_overdues + old_checkouts' => sub { |
561 |
subtest 'checkouts + pending_checkouts + overdues + old_checkouts' => sub { |
| 562 |
plan tests => 17; |
562 |
plan tests => 17; |
| 563 |
|
563 |
|
| 564 |
my $library = $builder->build( { source => 'Branch' } ); |
564 |
my $library = $builder->build( { source => 'Branch' } ); |
|
Lines 620-628
subtest 'checkouts + pending_checkouts + get_overdues + old_checkouts' => sub {
Link Here
|
| 620 |
my $first_checkout = $pending_checkouts->next; |
620 |
my $first_checkout = $pending_checkouts->next; |
| 621 |
is( $first_checkout->unblessed_all_relateds->{biblionumber}, $item_3->biblionumber, 'pending_checkouts should prefetch values from other tables (here biblio)' ); |
621 |
is( $first_checkout->unblessed_all_relateds->{biblionumber}, $item_3->biblionumber, 'pending_checkouts should prefetch values from other tables (here biblio)' ); |
| 622 |
|
622 |
|
| 623 |
my $overdues = $patron->get_overdues; |
623 |
my $overdues = $patron->overdues; |
| 624 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
624 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
| 625 |
is( ref($overdues), 'Koha::Checkouts', 'Koha::Patron->get_overdues should return Koha::Checkouts' ); |
625 |
is( ref($overdues), 'Koha::Checkouts', 'Koha::Patron->overdues should return Koha::Checkouts' ); |
| 626 |
is( $overdues->next->itemnumber, $item_1->itemnumber, 'The issue should be returned in the same order as they have been done, first is correct' ); |
626 |
is( $overdues->next->itemnumber, $item_1->itemnumber, 'The issue should be returned in the same order as they have been done, first is correct' ); |
| 627 |
is( $overdues->next->itemnumber, $item_2->itemnumber, 'The issue should be returned in the same order as they have been done, second is correct' ); |
627 |
is( $overdues->next->itemnumber, $item_2->itemnumber, 'The issue should be returned in the same order as they have been done, second is correct' ); |
| 628 |
|
628 |
|
|
Lines 1419-1425
subtest 'is_child | is_adult' => sub {
Link Here
|
| 1419 |
$patron_other->delete; |
1419 |
$patron_other->delete; |
| 1420 |
}; |
1420 |
}; |
| 1421 |
|
1421 |
|
| 1422 |
subtest 'get_overdues' => sub { |
1422 |
subtest 'overdues' => sub { |
| 1423 |
plan tests => 7; |
1423 |
plan tests => 7; |
| 1424 |
|
1424 |
|
| 1425 |
my $library = $builder->build( { source => 'Branch' } ); |
1425 |
my $library = $builder->build( { source => 'Branch' } ); |
|
Lines 1456-1462
subtest 'get_overdues' => sub {
Link Here
|
| 1456 |
AddIssue( $patron, $item_3->barcode ); |
1456 |
AddIssue( $patron, $item_3->barcode ); |
| 1457 |
|
1457 |
|
| 1458 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
1458 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
| 1459 |
my $overdues = $patron->get_overdues; |
1459 |
my $overdues = $patron->overdues; |
| 1460 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
1460 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
| 1461 |
is( $overdues->next->itemnumber, $item_1->itemnumber, 'The issue should be returned in the same order as they have been done, first is correct' ); |
1461 |
is( $overdues->next->itemnumber, $item_1->itemnumber, 'The issue should be returned in the same order as they have been done, first is correct' ); |
| 1462 |
is( $overdues->next->itemnumber, $item_2->itemnumber, 'The issue should be returned in the same order as they have been done, second is correct' ); |
1462 |
is( $overdues->next->itemnumber, $item_2->itemnumber, 'The issue should be returned in the same order as they have been done, second is correct' ); |
| 1463 |
- |
|
|