View | Details | Raw Unified | Return to bug 21468
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Plugins/Circulation_hooks.t (-3 / +2 lines)
Lines 22-28 use Test::Warn; Link Here
22
22
23
use File::Basename;
23
use File::Basename;
24
24
25
use C4::Circulation qw(AddIssue AddRenewal);
25
use C4::Circulation qw(AddIssue AddRenewal AddReturn);
26
26
27
use t::lib::Mocks;
27
use t::lib::Mocks;
28
use t::lib::TestBuilder;
28
use t::lib::TestBuilder;
Lines 92-99 subtest 'after_circ_action() hook tests' => sub { Link Here
92
        plan tests => 1;
92
        plan tests => 1;
93
93
94
        warning_like {
94
        warning_like {
95
            AddReturn( $patron->borrowernumber, $item->id,
95
            AddReturn( $item->barcode, $patron->branchcode );
96
                $patron->branchcode );
97
        }
96
        }
98
        qr/after_circ_action called with action: checkin, ref: DateTime/,
97
        qr/after_circ_action called with action: checkin, ref: DateTime/,
99
          'AddReturn calls the after_circ_action hook';
98
          'AddReturn calls the after_circ_action hook';
(-)a/t/lib/Koha/Plugin/Test.pm (-3 / +21 lines)
Lines 160-167 sub after_circ_action { Link Here
160
160
161
    my $action   = $params->{action};
161
    my $action   = $params->{action};
162
    my $checkout = $params->{payload}->{checkout};
162
    my $checkout = $params->{payload}->{checkout};
163
163
    my $payload  = $params->{payload};
164
    Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($checkout));
164
165
    my $renewal_library_id = $payload->{renewal_library_id};
166
    my $charge             = $payload->{charge};
167
    my $item_id            = $payload->{item_id};
168
    my $item_type          = $payload->{item_type};
169
    my $shelving_location  = $payload->{shelving_location};
170
    my $patron_id          = $payload->{patron_id};
171
    my $collection_code    = $payload->{collection_code};
172
    my $date_due           = $payload->{date_due};
173
    my $date_returned      = $payload->{date_returned};
174
175
    if ( $action eq 'renewal' ) {
176
        Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($checkout));
177
    }
178
    elsif ( $action eq 'checkout') {
179
        Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($date_due));
180
    }
181
    elsif ( $action eq 'checkin' ) {
182
        Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($date_returned));
183
    }
165
}
184
}
166
185
167
sub api_routes {
186
sub api_routes {
168
- 

Return to bug 21468