Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 11; |
22 |
use Test::More tests => 12; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
25 |
use C4::Members; |
25 |
use C4::Members; |
Lines 165-170
subtest 'update_password' => sub {
Link Here
|
165 |
is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->update_password should not have logged' ); |
165 |
is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->update_password should not have logged' ); |
166 |
}; |
166 |
}; |
167 |
|
167 |
|
|
|
168 |
subtest 'is_expired' => sub { |
169 |
plan tests => 5; |
170 |
my $patron = $builder->build({ source => 'Borrower' }); |
171 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
172 |
$patron->dateexpiry( undef )->store; |
173 |
is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not set'); |
174 |
$patron->dateexpiry( '0000-00-00' )->store; |
175 |
is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not 0000-00-00'); |
176 |
$patron->dateexpiry( dt_from_string )->store; |
177 |
is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is today'); |
178 |
$patron->dateexpiry( dt_from_string->add( days => 1 ) )->store; |
179 |
is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is tomorrow'); |
180 |
$patron->dateexpiry( dt_from_string->add( days => -1 ) )->store; |
181 |
is( $patron->is_expired, 1, 'Patron should be considered expired if dateexpiry is yesterday'); |
182 |
|
183 |
$patron->delete; |
184 |
}; |
185 |
|
168 |
subtest 'renew_account' => sub { |
186 |
subtest 'renew_account' => sub { |
169 |
plan tests => 10; |
187 |
plan tests => 10; |
170 |
my $a_month_ago = dt_from_string->add( months => -1 )->truncate( to => 'day' ); |
188 |
my $a_month_ago = dt_from_string->add( months => -1 )->truncate( to => 'day' ); |
171 |
- |
|
|