Lines 427-434
subtest 'add_enrolment_fee_if_needed' => sub {
Link Here
|
427 |
$patron->delete; |
427 |
$patron->delete; |
428 |
}; |
428 |
}; |
429 |
|
429 |
|
430 |
subtest 'checkouts + get_overdues + old_checkouts' => sub { |
430 |
subtest 'checkouts + pending_checkouts + get_overdues + old_checkouts' => sub { |
431 |
plan tests => 12; |
431 |
plan tests => 17; |
432 |
|
432 |
|
433 |
my $library = $builder->build( { source => 'Branch' } ); |
433 |
my $library = $builder->build( { source => 'Branch' } ); |
434 |
my ($biblionumber_1) = AddBiblio( MARC::Record->new, '' ); |
434 |
my ($biblionumber_1) = AddBiblio( MARC::Record->new, '' ); |
Lines 480-485
subtest 'checkouts + get_overdues + old_checkouts' => sub {
Link Here
|
480 |
my $checkouts = $patron->checkouts; |
480 |
my $checkouts = $patron->checkouts; |
481 |
is( $checkouts->count, 0, 'checkouts should not return any issues for that patron' ); |
481 |
is( $checkouts->count, 0, 'checkouts should not return any issues for that patron' ); |
482 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
482 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
|
|
483 |
my $pending_checkouts = $patron->pending_checkouts; |
484 |
is( $pending_checkouts->count, 0, 'pending_checkouts should not return any issues for that patron' ); |
485 |
is( ref($pending_checkouts), 'Koha::Checkouts', 'pending_checkouts should return a Koha::Checkouts object' ); |
483 |
my $old_checkouts = $patron->old_checkouts; |
486 |
my $old_checkouts = $patron->old_checkouts; |
484 |
is( $old_checkouts->count, 0, 'old_checkouts should not return any issues for that patron' ); |
487 |
is( $old_checkouts->count, 0, 'old_checkouts should not return any issues for that patron' ); |
485 |
is( ref($old_checkouts), 'Koha::Old::Checkouts', 'old_checkouts should return a Koha::Old::Checkouts object' ); |
488 |
is( ref($old_checkouts), 'Koha::Old::Checkouts', 'old_checkouts should return a Koha::Old::Checkouts object' ); |
Lines 498-503
subtest 'checkouts + get_overdues + old_checkouts' => sub {
Link Here
|
498 |
$checkouts = $patron->checkouts; |
501 |
$checkouts = $patron->checkouts; |
499 |
is( $checkouts->count, 3, 'checkouts should return 3 issues for that patron' ); |
502 |
is( $checkouts->count, 3, 'checkouts should return 3 issues for that patron' ); |
500 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
503 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
|
|
504 |
$pending_checkouts = $patron->pending_checkouts; |
505 |
is( $pending_checkouts->count, 3, 'pending_checkouts should return 3 issues for that patron' ); |
506 |
is( ref($pending_checkouts), 'Koha::Checkouts', 'pending_checkouts should return a Koha::Checkouts object' ); |
507 |
|
508 |
my $first_checkout = $pending_checkouts->next; |
509 |
is( $first_checkout->unblessed_all_relateds->{biblionumber}, $item_3->{biblionumber}, 'pending_checkouts should prefetch values from other tables (here biblio)' ); |
501 |
|
510 |
|
502 |
my $overdues = $patron->get_overdues; |
511 |
my $overdues = $patron->get_overdues; |
503 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
512 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
504 |
- |
|
|