Lines 471-496
subtest 'get_overdues' => sub {
Link Here
|
471 |
$patron->delete; |
471 |
$patron->delete; |
472 |
}; |
472 |
}; |
473 |
|
473 |
|
474 |
subtest 'get_account_lines' => sub { |
474 |
subtest 'account' => sub { |
475 |
plan tests => 2; |
475 |
plan tests => 1; |
476 |
|
476 |
|
477 |
my $patron = $builder->build({source => 'Borrower'}); |
477 |
my $patron = $builder->build({source => 'Borrower'}); |
478 |
|
478 |
|
479 |
my $accountline_1 = $builder->build({ source => 'Accountline', |
|
|
480 |
value => { borrowernumber => $patron->{borrowernumber}, |
481 |
amount => 42, |
482 |
amountoutstanding => 42 } |
483 |
}); |
484 |
my $accountline_2 = $builder->build({ source => 'Accountline', |
485 |
value => { borrowernumber => $patron->{borrowernumber}, |
486 |
amount => -13, |
487 |
amountoutstanding => -13 } |
488 |
}); |
489 |
|
490 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
479 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
491 |
my $account_lines = $patron->get_account_lines; |
480 |
my $account = $patron->account; |
492 |
is( $account_lines->count, 2, 'There should have 2 account lines for that patron' ); |
481 |
is( ref($account), 'Koha::Account', 'account should return a Koha::Account object' ); |
493 |
is( ref($account_lines), 'Koha::Account::Lines', 'get_account_lines should return a Koha::Account::Lines object' ); |
|
|
494 |
|
482 |
|
495 |
$patron->delete; |
483 |
$patron->delete; |
496 |
}; |
484 |
}; |
497 |
- |
|
|