Bug 24031: Add hook to test plugin with unit test
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Jul 2020 15:32:57 +0000 (11:32 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 30 Jul 2020 15:30:23 +0000 (17:30 +0200)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

t/db_dependent/Koha/Plugins/Plugins.t
t/lib/Koha/Plugin/Test.pm

index e6a353c..92b5c5c 100755 (executable)
@@ -25,7 +25,7 @@ use File::Temp qw( tempdir tempfile );
 use FindBin qw($Bin);
 use Module::Load::Conditional qw(can_load);
 use Test::MockModule;
-use Test::More tests => 52;
+use Test::More tests => 53;
 
 use C4::Context;
 use Koha::Database;
@@ -169,6 +169,7 @@ ok( $plugin->can('to_marc'), 'Test plugin can to_marc' );
 ok( $plugin->can('intranet_catalog_biblio_enhancements'), 'Test plugin can intranet_catalog_biblio_enhancements');
 ok( $plugin->can('intranet_catalog_biblio_enhancements_toolbar_button'), 'Test plugin can intranet_catalog_biblio_enhancements_toolbar_button' );
 ok( $plugin->can('opac_online_payment'), 'Test plugin can opac_online_payment' );
+ok( $plugin->can('after_hold_create'), 'Test plugin can after_hold_create' );
 ok( $plugin->can('opac_online_payment_begin'), 'Test plugin can opac_online_payment_begin' );
 ok( $plugin->can('opac_online_payment_end'), 'Test plugin can opac_online_payment_end' );
 ok( $plugin->can('opac_head'), 'Test plugin can opac_head' );
index 0f104b4..98ee801 100644 (file)
@@ -127,6 +127,10 @@ sub api_namespace {
     return "testplugin";
 }
 
+sub after_hold_create {
+    return "Koha::Plugin::Test::after_hold_create";
+}
+
 sub after_biblio_action {
     my ( $self, $params ) = @_;
     my $action    = $params->{action} // '';