From 1530ea0735a75f02f4bfd74ffb964f9f2581d082 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 30 Jan 2023 17:27:53 +0000 Subject: [PATCH] Bug 31095: (Rebase follow-up) Correct fine rules and AddIssue calls This patch corrects the errant call to AddIssue that passes a patron object instread of a patron hash to AddIssue in the tests and also adds lengthunit to squash a pair of warnings. However, it doesn't resolve the failing test.. still somthing going on there. Signed-off-by: Tomas Cohen Arazi Bug 31095: Fix Circulation.t Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 50f997a4b4376845cd812980e0e667698dd7f0f8) Signed-off-by: Matt Blenkinsop --- t/db_dependent/Circulation.t | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 84389d6006..d06b8d688d 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -2856,39 +2856,40 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { categorycode => undef, itemtype => undef, branchcode => undef, - rules => { - finedays => 0, - } + rules => { + finedays => 0, + lengthunit => 'days', + } } ); Koha::Patron::Debarments::AddDebarment( { - borrowernumber => $patron->{borrowernumber}, + borrowernumber => $patron->borrowernumber, expiration => '9999-12-31', type => 'MANUAL', } ); - AddIssue( $patron, $item_1->barcode, $now->clone->subtract( days => 1 ) ); + AddIssue( $patron->unblessed, $item_1->barcode, $now->clone->subtract( days => 1 ) ); my ( undef, $message ) = AddReturn( $item_1->barcode, $library->{branchcode}, undef, $now ); is( $message->{WasReturned} && exists $message->{ForeverDebarred}, 1, 'Forever debarred message for Addreturn when overdue'); Koha::Patron::Debarments::DelUniqueDebarment( { - borrowernumber => $patron->{borrowernumber}, + borrowernumber => $patron->borrowernumber, type => 'MANUAL', } ); Koha::Patron::Debarments::AddDebarment( { - borrowernumber => $patron->{borrowernumber}, + borrowernumber => $patron->borrowernumber, expiration => $now->clone->add( days => 10 ), type => 'MANUAL', } ); - AddIssue( $patron, $item_1->barcode, $now->clone->subtract( days => 1 ) ); + AddIssue( $patron->unblessed, $item_1->barcode, $now->clone->subtract( days => 1 ) ); (undef, $message) = AddReturn( $item_1->barcode, $library->{branchcode}, undef, $now ); is( $message->{WasReturned} && exists $message->{PrevDebarred}, 1, 'Previously debarred message for Addreturn when overdue'); }; -- 2.39.2