|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 15; |
22 |
use Test::More tests => 16; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
use DateTime; |
24 |
use DateTime; |
| 25 |
|
25 |
|
|
Lines 636-641
subtest 'get_overdues' => sub {
Link Here
|
| 636 |
$patron->delete; |
636 |
$patron->delete; |
| 637 |
}; |
637 |
}; |
| 638 |
|
638 |
|
|
|
639 |
subtest 'get_account_lines' => sub { |
| 640 |
plan tests => 2; |
| 641 |
|
| 642 |
my $patron = $builder->build({source => 'Borrower'}); |
| 643 |
|
| 644 |
my $accountline_1 = $builder->build({ source => 'Accountline', |
| 645 |
value => { borrowernumber => $patron->{borrowernumber}, |
| 646 |
amount => 42, |
| 647 |
amountoutstanding => 42 } |
| 648 |
}); |
| 649 |
my $accountline_2 = $builder->build({ source => 'Accountline', |
| 650 |
value => { borrowernumber => $patron->{borrowernumber}, |
| 651 |
amount => -13, |
| 652 |
amountoutstanding => -13 } |
| 653 |
}); |
| 654 |
|
| 655 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
| 656 |
my $account_lines = $patron->get_account_lines; |
| 657 |
is( $account_lines->count, 2, 'There should have 2 account lines for that patron' ); |
| 658 |
is( ref($account_lines), 'Koha::Account::Lines', 'get_account_lines should return a Koha::Account::Lines object' ); |
| 659 |
|
| 660 |
$patron->delete; |
| 661 |
}; |
| 662 |
|
| 639 |
$retrieved_patron_1->delete; |
663 |
$retrieved_patron_1->delete; |
| 640 |
is( Koha::Patrons->search->count, $nb_of_patrons + 1, 'Delete should have deleted the patron' ); |
664 |
is( Koha::Patrons->search->count, $nb_of_patrons + 1, 'Delete should have deleted the patron' ); |
| 641 |
|
665 |
|
| 642 |
- |
|
|