Bug 29021: (QA follow-up) Fix for new parameter, add unit test

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kyle Hall 2023-01-27 11:58:45 -05:00 committed by Tomas Cohen Arazi
parent 5b87d7a473
commit d1bd38d853
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 3 additions and 2 deletions

View file

@ -1035,6 +1035,7 @@ sub renew_item {
$self->{branchcode},
undef,
undef,
undef,
0
);
return {

View file

@ -568,10 +568,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;
};