https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18146
Bug ID: 18146 Summary: C4::Circulation CanBookBeRenewed lacks full test coverage. Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: ch...@bigballofwax.co.nz Reporter: mtomp...@hotmail.com QA Contact: gmcha...@gmail.com While testing bug 17941, I discovered two cases where test coverage was lacking from t/db_dependent/Circulation.t Around line 2725: if ( $restricted and $restrictionblockrenewing ) { return ( 0, 'restriction'); } elsif ( ($hasoverdues and $overduesblockrenewing eq 'block') || ($itemissue->{overdue} and $overduesblockrenewing eq 'blockitem') ) { return ( 0, 'overdue'); } The elseif is never triggered. Around line 2759: if ( $soonestrenewal > DateTime->now( time_zone => C4::Context->tz() ) ) { return ( 0, "auto_too_soon" ) if $itemissue->{auto_renew}; return ( 0, "too_soon" ); } elsif ( $itemissue->{auto_renew} ) { return ( 0, "auto_renew" ); } There is no else, but the code never attempts something that would trigger one. To reproduce add: print STDERR "CHECK!\n"; just before the return ( 0, 'overdue') in the first case, and after the elsif's curly brace in the second case. running t/db_dependent/Circulation should not generate the CHECK points. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/