[Koha-bugs] [Bug 25855] Add post_renewal_hook in circulation

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jul 2 13:27:22 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25855

--- Comment #7 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Comment on attachment 106248
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106248
Bug 25855: Unit tests

Review of attachment 106248:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=25855&attachment=106248)
-----------------------------------------------------------------

::: t/db_dependent/Koha/Plugins/Circulation_hooks.t
@@ +68,5 @@
> +            'AddBiblio calls the hook with action=create';
> +
> +    warning_like { $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); }
> +            qr/after_item_action called with action: create, ref: Koha::Item/,
> +            'AddItem calls the hook with action=create';

Hmm.. does it make sense to additionally test the AddBiblio and AddItem hooks
here.. they're already well tested within
Koha/Plugins/Biblio_and_Items_plugin_hooks.t aren't they?

@@ +72,5 @@
> +            'AddItem calls the hook with action=create';
> +
> +    warning_like { AddIssue( $patron->unblessed, $item->barcode ); }
> +            qr/after_item_action called with action: modify, ref: Koha::Item/,
> +            'AddItem calls the hook with action=modify';

'AddIssue' is being tested here.. not AddItem... must admit it feels a little
strange that we trigger the item modification hook on an issue.. though I think
I understand how that comes about.

@@ +77,5 @@
> +
> +    warnings_like { AddRenewal( $patron->borrowernumber, $item->id, $patron->branchcode ); }
> +            [ qr/after_item_action called with action: modify, ref: Koha::Item/,
> +              qr/post_renewal_action .* DateTime/ ],
> +            'AddRenewal calls the post_renewal_action hook';

I have a vague feeling renewals can be triggered via AddIssue as well as
AddRenewal.... might be worth also testing that case to make sure you're always
triggering as expected.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list