Bug 30362: Unit test

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 145788398a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a419589998)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2022-03-25 15:18:27 +00:00 committed by Matt Blenkinsop
parent f9c1bc1f34
commit 8bd50acd17
1 changed files with 17 additions and 0 deletions

View File

@ -5764,6 +5764,23 @@ subtest "GetSoonestRenewDate tests" => sub {
$datedue,
'Checkouts with auto-renewal can be renewed earliest on due date if no renewalbefore'
);
t::lib::Mocks::mock_preference( 'NoRenewalBeforePrecision', 'date' );
Koha::CirculationRules->set_rule(
{
categorycode => undef,
branchcode => undef,
itemtype => undef,
rule_name => 'norenewalbefore',
rule_value => 1,
}
);
$issue->date_due( dt_from_string )->store;
is(
GetSoonestRenewDate( $patron->id, $item->itemnumber ),
dt_from_string->truncate( to => 'day' ),
'Checkouts with auto-renewal can be renewed 1 day before due date if no renewalbefore = 1 and precision = "date"'
);
};
subtest "CanBookBeIssued + needsconfirmation message" => sub {