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

(-)a/t/db_dependent/Koha/Patrons.t (-5 / +4 lines)
Lines 190-197 subtest 'is_expired' => sub { Link Here
190
    $patron = Koha::Patrons->find( $patron->{borrowernumber} );
190
    $patron = Koha::Patrons->find( $patron->{borrowernumber} );
191
    $patron->dateexpiry( undef )->store->discard_changes;
191
    $patron->dateexpiry( undef )->store->discard_changes;
192
    is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not set');
192
    is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not set');
193
    $patron->dateexpiry( '0000-00-00' )->store->discard_changes;
193
    $patron->dateexpiry( '0000-00-00' );
194
    is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is not 0000-00-00');
194
    is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is 0000-00-00');
195
    $patron->dateexpiry( dt_from_string )->store->discard_changes;
195
    $patron->dateexpiry( dt_from_string )->store->discard_changes;
196
    is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is today');
196
    is( $patron->is_expired, 0, 'Patron should not be considered expired if dateexpiry is today');
197
    $patron->dateexpiry( dt_from_string->add( days => 1 ) )->store->discard_changes;
197
    $patron->dateexpiry( dt_from_string->add( days => 1 ) )->store->discard_changes;
Lines 208-215 subtest 'is_going_to_expire' => sub { Link Here
208
    $patron = Koha::Patrons->find( $patron->{borrowernumber} );
208
    $patron = Koha::Patrons->find( $patron->{borrowernumber} );
209
    $patron->dateexpiry( undef )->store->discard_changes;
209
    $patron->dateexpiry( undef )->store->discard_changes;
210
    is( $patron->is_going_to_expire, 0, 'Patron should not be considered going to expire if dateexpiry is not set');
210
    is( $patron->is_going_to_expire, 0, 'Patron should not be considered going to expire if dateexpiry is not set');
211
    $patron->dateexpiry( '0000-00-00' )->store->discard_changes;
211
    $patron->dateexpiry( '0000-00-00' );
212
    is( $patron->is_going_to_expire, 0, 'Patron should not be considered going to expire if dateexpiry is not 0000-00-00');
212
    is( $patron->is_going_to_expire, 0, 'Patron should not be considered going to expire if dateexpiry is 0000-00-00');
213
213
214
    t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 0);
214
    t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 0);
215
    $patron->dateexpiry( dt_from_string )->store->discard_changes;
215
    $patron->dateexpiry( dt_from_string )->store->discard_changes;
216
- 

Return to bug 20144