|
Lines 172-177
subtest 'update_password' => sub {
Link Here
|
| 172 |
is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->update_password should not have logged' ); |
172 |
is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->update_password should not have logged' ); |
| 173 |
}; |
173 |
}; |
| 174 |
|
174 |
|
|
|
175 |
subtest 'is_expired' => sub { |
| 176 |
plan tests => 5; |
| 177 |
my $patron = $builder->build({ source => 'Borrower' }); |
| 178 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
| 179 |
$patron->dateexpiry( undef )->store; |
| 180 |
is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not set'); |
| 181 |
$patron->dateexpiry( '0000-00-00' )->store; |
| 182 |
is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not 0000-00-00'); |
| 183 |
$patron->dateexpiry( dt_from_string )->store; |
| 184 |
is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is today'); |
| 185 |
$patron->dateexpiry( dt_from_string->add( days => 1 ) )->store; |
| 186 |
is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is tomorrow'); |
| 187 |
$patron->dateexpiry( dt_from_string->add( days => -1 ) )->store; |
| 188 |
is( $patron->is_expired, 1, 'Patron should be considered expired if dateexpiry is yesterday'); |
| 189 |
|
| 190 |
$patron->delete; |
| 191 |
}; |
| 192 |
|
| 175 |
subtest 'renew_account' => sub { |
193 |
subtest 'renew_account' => sub { |
| 176 |
plan tests => 10; |
194 |
plan tests => 10; |
| 177 |
my $a_month_ago = dt_from_string->add( months => -1 )->truncate( to => 'day' ); |
195 |
my $a_month_ago = dt_from_string->add( months => -1 )->truncate( to => 'day' ); |
| 178 |
- |
|
|