Bug 17583: Mock the pref before tests

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-11-15 11:16:03 +00:00 committed by Kyle M Hall
parent ac281a1291
commit 6bea1c641f

View file

@ -198,10 +198,11 @@ subtest 'is_going_to_expired' => sub {
is( $patron->is_going_to_expired, 0, 'Patron should not be considered going to expire if dateexpiry is not set');
$patron->dateexpiry( '0000-00-00' )->store->discard_changes;
is( $patron->is_going_to_expired, 0, 'Patron should not be considered going to expire if dateexpiry is not 0000-00-00');
t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 0);
$patron->dateexpiry( dt_from_string )->store->discard_changes;
is( $patron->is_going_to_expired, 0, 'Patron should not be considered going to expire if dateexpiry is today');
t::lib::Mocks::mock_preference('NotifyBorrowerDeparture', 0);
$patron->dateexpiry( dt_from_string )->store->discard_changes;
is( $patron->is_going_to_expired, 0, 'Patron should not be considered going to expire if dateexpiry is today and pref is 0');