From 10864b728bc2e949432269e1bcab9b24dabe6a29 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 15 Jul 2025 14:32:25 +0200 Subject: [PATCH] Bug 40384: Remove warnings from Koha/Plugins/Patron.t t/db_dependent/Koha/Plugins/Patron.t .. 1/5 Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'patron_barcode_transform called with parameter: test_cn_1' Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'patron_barcode_transform called with parameter: test_cn_1' Plugin error (Test Plugin): Exception 'Koha::Exception' thrown 'patron_barcode_transform called with parameter: test_cn_1' --- t/db_dependent/Koha/Plugins/Patron.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Plugins/Patron.t b/t/db_dependent/Koha/Plugins/Patron.t index ebe4531b08a..da5382b64d0 100755 --- a/t/db_dependent/Koha/Plugins/Patron.t +++ b/t/db_dependent/Koha/Plugins/Patron.t @@ -16,8 +16,10 @@ use Modern::Perl; -use Test::More tests => 5; +use Test::More tests => 6; +use Test::NoWarnings; use Test::Exception; +use Test::MockModule; use File::Basename; @@ -51,6 +53,10 @@ subtest 'check_password hook tests' => sub { my $plugins = Koha::Plugins->new; $plugins->InstallPlugins; + # Mock patron_barcode_transform: we don't want to call it as it generates warnings + my $plugin_mock = Test::MockModule->new("Koha::Plugin::Test"); + $plugin_mock->mock( "patron_barcode_transform", sub { } ); + # Test Plugin enforces a 4 digit numeric pin for passwords my $plugin = Koha::Plugin::Test->new->enable; -- 2.34.1