|
Lines 191-197
subtest 'is_expired' => sub {
Link Here
|
| 191 |
}; |
191 |
}; |
| 192 |
|
192 |
|
| 193 |
subtest 'is_going_to_expired' => sub { |
193 |
subtest 'is_going_to_expired' => sub { |
| 194 |
plan tests => 8; |
194 |
plan tests => 9; |
| 195 |
my $patron = $builder->build({ source => 'Borrower' }); |
195 |
my $patron = $builder->build({ source => 'Borrower' }); |
| 196 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
196 |
$patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
| 197 |
$patron->dateexpiry( undef )->store; |
197 |
$patron->dateexpiry( undef )->store; |
|
Lines 223-228
subtest 'is_going_to_expired' => sub {
Link Here
|
| 223 |
$patron->dateexpiry( dt_from_string->add( days => 20 ) )->store; |
223 |
$patron->dateexpiry( dt_from_string->add( days => 20 ) )->store; |
| 224 |
is( $patron->is_going_to_expired, 0, 'Patron should not be considered going to expire if dateexpiry is 20 days before and pref is 10'); |
224 |
is( $patron->is_going_to_expired, 0, 'Patron should not be considered going to expire if dateexpiry is 20 days before and pref is 10'); |
| 225 |
|
225 |
|
|
|
226 |
t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 20); |
| 227 |
$patron->dateexpiry( dt_from_string->add( days => 10 ) )->store; |
| 228 |
is( $patron->is_going_to_expired, 1, 'Patron should be considered going to expire if dateexpiry is 10 days before and pref is 20'); |
| 229 |
|
| 226 |
$patron->delete; |
230 |
$patron->delete; |
| 227 |
}; |
231 |
}; |
| 228 |
|
232 |
|
| 229 |
- |
|
|