Bug 18146: Fix tests for OverduesBlockRenewing
authorNick Clemens <nick@bywatersolutions.com>
Fri, 29 Jan 2021 15:19:26 +0000 (15:19 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 15 Feb 2021 10:59:24 +0000 (11:59 +0100)
commit03bb55f1047621ba41c589d8d3774f23cdde6241
treef1d3860325989a979dbf1db749bc834861a887e5
parentd9a97d4802716dab50ba90272d93d3dcf5ea98c8
Bug 18146: Fix tests for OverduesBlockRenewing

This pref was supposedly covered by tests, but the conditions were wrong
and we didn't test the reasons we were failing so the code was being missed

To test:
1 - Add a warn around in the conditional at line 2748:
} elsif ( ($hasoverdues and $overduesblockrenewing eq 'block') || ($itemissue->{overdue} and $overduesblockrenewing eq 'blockitem') ) {
     warn "SUCCESS!"
     return ( 0, 'overdue');
}
2 - prove -v t/db_dependent/Circulation.t | grep SUCCESS
3 - No output
4 - Apply patch
5 - Repeat
6 - SUCCESS!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Circulation.t