From e3931f3d0925c797e0faf58a589f2e28542c5313 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 8 Mar 2022 16:08:26 -0300 Subject: [PATCH] Bug 30194: (26351 follow-up) Silence useless warning Content-Type: text/plain; charset="utf-8" Every place in which Koha::Plugin::Test is loaded, and a patron is updated, this hook needs to be silenced. To reproduce: 1. Run: $ kshell k$ prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t => FAIL: There's a warn about patron_barcode_transform 2. Apply this patch 3. Repeat 1 => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Martin Renvoize Signed-off-by: Mason James --- t/db_dependent/Koha/REST/Plugin/PluginRoutes.t | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t b/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t index 1bd91c9015..66746508ed 100755 --- a/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t +++ b/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t @@ -138,6 +138,10 @@ subtest 'Permissions and access to plugin routes tests' => sub { # enable BASIC auth t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); + # Silence warnings from unrelated plugins feature + my $plugin_mock = Test::MockModule->new('Koha::Plugin::Test'); + $plugin_mock->mock( 'patron_barcode_transform', undef ); + # remove any existing plugins that might interfere Koha::Plugins::Methods->search->delete; my $plugins = Koha::Plugins->new; -- 2.20.1