View | Details | Raw Unified | Return to bug 17583
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Patrons.t (-2 / +5 lines)
Lines 184-190 subtest 'is_expired' => sub { Link Here
184
};
184
};
185
185
186
subtest 'is_going_to_expired' => sub {
186
subtest 'is_going_to_expired' => sub {
187
    plan tests => 8;
187
    plan tests => 9;
188
    my $patron = $builder->build({ source => 'Borrower' });
188
    my $patron = $builder->build({ source => 'Borrower' });
189
    $patron = Koha::Patrons->find( $patron->{borrowernumber} );
189
    $patron = Koha::Patrons->find( $patron->{borrowernumber} );
190
    $patron->dateexpiry( undef )->store;
190
    $patron->dateexpiry( undef )->store;
Lines 216-221 subtest 'is_going_to_expired' => sub { Link Here
216
    $patron->dateexpiry( dt_from_string->add( days => 20 ) )->store;
216
    $patron->dateexpiry( dt_from_string->add( days => 20 ) )->store;
217
    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');
217
    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');
218
218
219
    t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 20);
220
    $patron->dateexpiry( dt_from_string->add( days => 10 ) )->store;
221
    is( $patron->is_going_to_expired, 1, 'Patron should be considered going to expire if dateexpiry is 10 days before and pref is 20');
222
219
    $patron->delete;
223
    $patron->delete;
220
};
224
};
221
225
222
- 

Return to bug 17583