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

(-)a/t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t (-2 / +3 lines)
Lines 71-82 subtest 'after_biblio_action() and after_item_action() hooks tests' => sub { Link Here
71
            qr/after_item_action called with action: modify, ref: Koha::Item item_id defined: yes itemnumber defined: yes/,
71
            qr/after_item_action called with action: modify, ref: Koha::Item item_id defined: yes itemnumber defined: yes/,
72
            'ModItem calls the hook with action=modify';
72
            'ModItem calls the hook with action=modify';
73
73
74
    my $itemnumber = $item->id;
74
    warning_like { $item->delete; }
75
    warning_like { $item->delete; }
75
            qr/after_item_action called with action: delete/,
76
            qr/after_item_action called with action: delete, id: $itemnumber/,
76
            'DelItem calls the hook with action=delete, item_id passed';
77
            'DelItem calls the hook with action=delete, item_id passed';
77
78
78
    warning_like { C4::Biblio::DelBiblio( $biblio_id ); }
79
    warning_like { C4::Biblio::DelBiblio( $biblio_id ); }
79
            qr/after_biblio_action called with action: delete/,
80
            qr/after_biblio_action called with action: delete, id: $biblio_id/,
80
            'DelBiblio calls the hook with action=delete biblio_id passed';
81
            'DelBiblio calls the hook with action=delete biblio_id passed';
81
82
82
    $schema->storage->txn_rollback;
83
    $schema->storage->txn_rollback;
(-)a/t/lib/Koha/Plugin/Test.pm (-3 / +2 lines)
Lines 142-148 sub after_biblio_action { Link Here
142
        Koha::Exceptions::Exception->throw("after_biblio_action called with action: $action, ref: " . ref($biblio) );
142
        Koha::Exceptions::Exception->throw("after_biblio_action called with action: $action, ref: " . ref($biblio) );
143
    }
143
    }
144
    else {
144
    else {
145
        Koha::Exceptions::Exception->throw("after_biblio_action called with action: $action") if $biblio_id;
145
        Koha::Exceptions::Exception->throw("after_biblio_action called with action: $action, id: $biblio_id") if $biblio_id;
146
    }
146
    }
147
}
147
}
148
148
Lines 160-166 sub after_item_action { Link Here
160
                                           "itemnumber defined: $itemnumber_defined" );
160
                                           "itemnumber defined: $itemnumber_defined" );
161
    }
161
    }
162
    else {
162
    else {
163
        Koha::Exceptions::Exception->throw("after_item_action called with action: $action" ) if $item_id;
163
        Koha::Exceptions::Exception->throw("after_item_action called with action: $action, id: $item_id" ) if $item_id;
164
    }
164
    }
165
}
165
}
166
166
167
- 

Return to bug 27155