Bugzilla – Attachment 106887 Details for
Bug 21468
Plugins need hooks for checkin and checkout actions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21468: (QA follow-up) Enhance tests
Bug-21468-QA-follow-up-Enhance-tests.patch (text/plain), 2.22 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-07-15 05:30:00 UTC
(
hide
)
Description:
Bug 21468: (QA follow-up) Enhance tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-07-15 05:30:00 UTC
Size:
2.22 KB
patch
obsolete
>From ec1cde1d0e60fb1d2d0ca4bbcfc7e7c15ad08b10 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 15 Jul 2020 02:26:20 -0300 >Subject: [PATCH] Bug 21468: (QA follow-up) Enhance tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Plugins/Circulation_hooks.t | 5 ++--- > t/lib/Koha/Plugin/Test.pm | 8 +++++++- > 2 files changed, 9 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Koha/Plugins/Circulation_hooks.t b/t/db_dependent/Koha/Plugins/Circulation_hooks.t >index 031da43f7af..5739a71861d 100755 >--- a/t/db_dependent/Koha/Plugins/Circulation_hooks.t >+++ b/t/db_dependent/Koha/Plugins/Circulation_hooks.t >@@ -22,7 +22,7 @@ use Test::Warn; > > use File::Basename; > >-use C4::Circulation qw(AddIssue AddRenewal); >+use C4::Circulation qw(AddIssue AddRenewal AddReturn); > > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -95,8 +95,7 @@ subtest '_after_circ_action() hook tests' => sub { > plan tests => 1; > > warning_like { >- AddReturn( $patron->borrowernumber, $item->id, >- $patron->branchcode ); >+ AddReturn( $item->barcode, $patron->branchcode ); > } > qr/after_circ_action called with action: checkin, ref: DateTime/, > 'AddReturn calls the after_circ_action hook'; >diff --git a/t/lib/Koha/Plugin/Test.pm b/t/lib/Koha/Plugin/Test.pm >index 98da8af73aa..29864fac2f0 100644 >--- a/t/lib/Koha/Plugin/Test.pm >+++ b/t/lib/Koha/Plugin/Test.pm >@@ -169,8 +169,14 @@ sub after_circ_action { > my $patron_id = $payload->{patron_id}; > my $collection_code = $payload->{collection_code}; > my $date_due = $payload->{date_due}; >+ my $date_returned = $payload->{date_returned}; > >- Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($date_due)); >+ if ( $action eq 'renewal' or $action eq 'checkout') { >+ Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($date_due)); >+ } >+ elsif ( $action eq 'checkin' ) { >+ Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($date_returned)); >+ } > } > > sub api_routes { >-- >2.27.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21468
:
106571
|
106572
|
106573
|
106574
|
106580
|
106581
|
106582
|
106583
|
106883
|
106884
|
106885
|
106886
|
106887
|
107261
|
107262
|
107263
|
107264
|
107265
|
107266