Lines 412-418
subtest 'add_enrolment_fee_if_needed' => sub {
Link Here
|
412 |
$patron->delete; |
412 |
$patron->delete; |
413 |
}; |
413 |
}; |
414 |
|
414 |
|
415 |
subtest 'get_checkouts + get_overdues' => sub { |
415 |
subtest 'checkouts + get_overdues' => sub { |
416 |
plan tests => 8; |
416 |
plan tests => 8; |
417 |
|
417 |
|
418 |
my $library = $builder->build( { source => 'Branch' } ); |
418 |
my $library = $builder->build( { source => 'Branch' } ); |
Lines 456-464
subtest 'get_checkouts + get_overdues' => sub {
Link Here
|
456 |
); |
456 |
); |
457 |
|
457 |
|
458 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
458 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
459 |
my $checkouts = $patron->get_checkouts; |
459 |
my $checkouts = $patron->checkouts; |
460 |
is( $checkouts->count, 0, 'get_checkouts should not return any issues for that patron' ); |
460 |
is( $checkouts->count, 0, 'checkouts should not return any issues for that patron' ); |
461 |
is( ref($checkouts), 'Koha::Checkouts', 'get_checkouts should return a Koha::Checkouts object' ); |
461 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
462 |
|
462 |
|
463 |
# Not sure how this is useful, but AddIssue pass this variable to different other subroutines |
463 |
# Not sure how this is useful, but AddIssue pass this variable to different other subroutines |
464 |
$patron = GetMember( borrowernumber => $patron->borrowernumber ); |
464 |
$patron = GetMember( borrowernumber => $patron->borrowernumber ); |
Lines 471-479
subtest 'get_checkouts + get_overdues' => sub {
Link Here
|
471 |
AddIssue( $patron, $item_3->{barcode} ); |
471 |
AddIssue( $patron, $item_3->{barcode} ); |
472 |
|
472 |
|
473 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
473 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
474 |
$checkouts = $patron->get_checkouts; |
474 |
$checkouts = $patron->checkouts; |
475 |
is( $checkouts->count, 3, 'get_checkouts should return 3 issues for that patron' ); |
475 |
is( $checkouts->count, 3, 'checkouts should return 3 issues for that patron' ); |
476 |
is( ref($checkouts), 'Koha::Checkouts', 'get_checkouts should return a Koha::Checkouts object' ); |
476 |
is( ref($checkouts), 'Koha::Checkouts', 'checkouts should return a Koha::Checkouts object' ); |
477 |
|
477 |
|
478 |
my $overdues = $patron->get_overdues; |
478 |
my $overdues = $patron->get_overdues; |
479 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
479 |
is( $overdues->count, 2, 'Patron should have 2 overdues'); |
480 |
- |
|
|