Lines 431-438
subtest 'add_enrolment_fee_if_needed' => sub {
Link Here
|
431 |
$patron->delete; |
431 |
$patron->delete; |
432 |
}; |
432 |
}; |
433 |
|
433 |
|
434 |
subtest 'checkouts + get_overdues + old_checkouts' => sub { |
434 |
subtest 'checkouts + pending_checkouts + get_overdues + old_checkouts' => sub { |
435 |
plan tests => 12; |
435 |
plan tests => 17; |
436 |
|
436 |
|
437 |
my $library = $builder->build( { source => 'Branch' } ); |
437 |
my $library = $builder->build( { source => 'Branch' } ); |
438 |
my ($biblionumber_1) = AddBiblio( MARC::Record->new, '' ); |
438 |
my ($biblionumber_1) = AddBiblio( MARC::Record->new, '' ); |
Lines 484-489
subtest 'checkouts + get_overdues + old_checkouts' => sub {
Link Here
|
484 |
my $checkouts = $patron->checkouts; |
484 |
my $checkouts = $patron->checkouts; |
485 |
is( $checkouts->count, 0, 'checkouts should not return any issues for that patron' ); |
485 |
is( $checkouts->count, 0, 'checkouts should not return any issues for that patron' ); |
486 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
486 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
|
|
487 |
my $pending_checkouts = $patron->pending_checkouts; |
488 |
is( $pending_checkouts->count, 0, 'pending_checkouts should not return any issues for that patron' ); |
489 |
is( ref($pending_checkouts), 'Koha::Checkouts', 'pending_checkouts should return a Koha::Checkouts object' ); |
487 |
my $old_checkouts = $patron->old_checkouts; |
490 |
my $old_checkouts = $patron->old_checkouts; |
488 |
is( $old_checkouts->count, 0, 'old_checkouts should not return any issues for that patron' ); |
491 |
is( $old_checkouts->count, 0, 'old_checkouts should not return any issues for that patron' ); |
489 |
is( ref($old_checkouts), 'Koha::Old::Checkouts', 'old_checkouts should return a Koha::Old::Checkouts object' ); |
492 |
is( ref($old_checkouts), 'Koha::Old::Checkouts', 'old_checkouts should return a Koha::Old::Checkouts object' ); |
Lines 502-507
subtest 'checkouts + get_overdues + old_checkouts' => sub {
Link Here
|
502 |
$checkouts = $patron->checkouts; |
505 |
$checkouts = $patron->checkouts; |
503 |
is( $checkouts->count, 3, 'checkouts should return 3 issues for that patron' ); |
506 |
is( $checkouts->count, 3, 'checkouts should return 3 issues for that patron' ); |
504 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
507 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
|
|
508 |
$pending_checkouts = $patron->pending_checkouts; |
509 |
is( $pending_checkouts->count, 3, 'pending_checkouts should return 3 issues for that patron' ); |
510 |
is( ref($pending_checkouts), 'Koha::Checkouts', 'pending_checkouts should return a Koha::Checkouts object' ); |
511 |
|
512 |
my $first_checkout = $pending_checkouts->next; |
513 |
is( $first_checkout->unblessed_all_relateds->{biblionumber}, $item_3->{biblionumber}, 'pending_checkouts should prefetch values from other tables (here biblio)' ); |
505 |
|
514 |
|
506 |
my $overdues = $patron->get_overdues; |
515 |
my $overdues = $patron->get_overdues; |
507 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
516 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
508 |
- |
|
|