Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 7; |
22 |
use Test::More tests => 8; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use C4::Circulation; |
25 |
use C4::Circulation; |
Lines 128-141
subtest 'has_overdues' => sub {
Link Here
|
128 |
is( $retrieved_patron->has_overdues, 0, ); |
128 |
is( $retrieved_patron->has_overdues, 0, ); |
129 |
|
129 |
|
130 |
my $tomorrow = DateTime->today( time_zone => C4::Context->tz() )->add( days => 1 ); |
130 |
my $tomorrow = DateTime->today( time_zone => C4::Context->tz() )->add( days => 1 ); |
131 |
my $issue = AddIssue( $new_patron_1->unblessed, $item_1->{barcode} ); |
131 |
my $issue = Koha::Issue->new({ borrowernumber => $new_patron_1->id, itemnumber => $item_1->{itemnumber}, date_due => $tomorrow, branchcode => $library->{branchcode} })->store(); |
132 |
is( $retrieved_patron->has_overdues, 0, ); |
132 |
is( $retrieved_patron->has_overdues, 0, ); |
133 |
AddReturn( $item_1->{barcode} ); |
133 |
$issue->delete(); |
134 |
my $yesterday = DateTime->today(time_zone => C4::Context->tz())->add( days => -1 ); |
134 |
my $yesterday = DateTime->today(time_zone => C4::Context->tz())->add( days => -1 ); |
135 |
$issue = AddIssue( $new_patron_1->unblessed, $item_1->{barcode}, $yesterday ); |
135 |
$issue = Koha::Issue->new({ borrowernumber => $new_patron_1->id, itemnumber => $item_1->{itemnumber}, date_due => $yesterday, branchcode => $library->{branchcode} })->store(); |
136 |
$retrieved_patron = Koha::Patrons->find( $new_patron_1->borrowernumber ); |
136 |
$retrieved_patron = Koha::Patrons->find( $new_patron_1->borrowernumber ); |
137 |
is( $retrieved_patron->has_overdues, 1, ); |
137 |
is( $retrieved_patron->has_overdues, 1, ); |
138 |
AddReturn( $item_1->{barcode} ); |
138 |
$issue->delete(); |
139 |
}; |
139 |
}; |
140 |
|
140 |
|
141 |
subtest 'update_password' => sub { |
141 |
subtest 'update_password' => sub { |
142 |
- |
|
|