From 26cc76369ef5a14a5bfaf4ffabeb72f036f8e0a0 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 27 Jan 2023 11:58:45 -0500 Subject: [PATCH] Bug 29021: (QA follow-up) Fix for new parameter, add unit test Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit d1bd38d85319ee4240df24c1e000e2b6362ad924) Signed-off-by: Jacob O'Mara (cherry picked from commit bce3f40d5944cc57e12c112ff0e58ea379d690ba) Signed-off-by: Lucas Gass --- Koha/Account/Line.pm | 1 + t/db_dependent/Koha/Account/Line.t | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index b8700293a6..4eb549bbd4 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -1035,6 +1035,7 @@ sub renew_item { $self->{branchcode}, undef, undef, + undef, 0 ); return { diff --git a/t/db_dependent/Koha/Account/Line.t b/t/db_dependent/Koha/Account/Line.t index fe593ae17b..ccf4b21974 100755 --- a/t/db_dependent/Koha/Account/Line.t +++ b/t/db_dependent/Koha/Account/Line.t @@ -565,10 +565,10 @@ subtest 'Renewal related tests' => sub { ); my $called = 0; my $module = Test::MockModule->new('C4::Circulation'); - $module->mock('AddRenewal', sub { $called = 1; }); $module->mock('CanBookBeRenewed', sub { return 1; }); $line->renew_item; - is( $called, 1, 'Attempt to renew succeeds when conditions are met' ); + my $r = Koha::Checkouts::Renewals->find({ checkout_id => $issue->id }); + is( $r->seen, 0, "RenewAccruingItemWhenPaid triggers an unseen renewal" ); $schema->storage->txn_rollback; }; -- 2.39.5