From 0f54ace6711c9035b267474c2f1ab69570f977b8 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 17 Jul 2020 11:32:57 -0400 Subject: [PATCH] Bug 24031: Add hook to test plugin with unit test Signed-off-by: Jonathan Druart --- t/db_dependent/Koha/Plugins/Plugins.t | 3 ++- t/lib/Koha/Plugin/Test.pm | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Plugins/Plugins.t b/t/db_dependent/Koha/Plugins/Plugins.t index e6a353ceee..92b5c5c6b7 100755 --- a/t/db_dependent/Koha/Plugins/Plugins.t +++ b/t/db_dependent/Koha/Plugins/Plugins.t @@ -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' ); diff --git a/t/lib/Koha/Plugin/Test.pm b/t/lib/Koha/Plugin/Test.pm index 0f104b4133..98ee80186b 100644 --- a/t/lib/Koha/Plugin/Test.pm +++ b/t/lib/Koha/Plugin/Test.pm @@ -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} // ''; -- 2.39.5