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 95-102 subtest '_after_circ_action() hook tests' => sub { Link Here
95
        plan tests => 1;
95
        plan tests => 1;
96
96
97
        warning_like {
97
        warning_like {
98
            AddReturn( $patron->borrowernumber, $item->id,
98
            AddReturn( $item->barcode, $patron->branchcode );
99
                $patron->branchcode );
100
        }
99
        }
101
        qr/after_circ_action called with action: checkin, ref: DateTime/,
100
        qr/after_circ_action called with action: checkin, ref: DateTime/,
102
          'AddReturn calls the after_circ_action hook';
101
          'AddReturn calls the after_circ_action hook';
(-)a/t/lib/Koha/Plugin/Test.pm (-2 / +7 lines)
Lines 169-176 sub after_circ_action { Link Here
169
    my $patron_id          = $payload->{patron_id};
169
    my $patron_id          = $payload->{patron_id};
170
    my $collection_code    = $payload->{collection_code};
170
    my $collection_code    = $payload->{collection_code};
171
    my $date_due           = $payload->{date_due};
171
    my $date_due           = $payload->{date_due};
172
    my $date_returned      = $payload->{date_returned};
172
173
173
    Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($date_due));
174
    if ( $action eq 'renewal' or $action eq 'checkout') {
175
        Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($date_due));
176
    }
177
    elsif ( $action eq 'checkin' ) {
178
        Koha::Exceptions::Exception->throw("after_circ_action called with action: $action, ref: " . ref($date_returned));
179
    }
174
}
180
}
175
181
176
sub api_routes {
182
sub api_routes {
177
- 

Return to bug 21468