From c68fdc291d2c24225da7afb722216a0b8ea06628 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 15 Jul 2025 12:09:47 +0200 Subject: [PATCH] Bug 40377: Remove warnings from HoldsQueue/TransportCostOptimizations.t UseTransportCostMatrix set to yes, but matrix not populated at /kohadevbox/koha/C4/HoldsQueue.pm line 188. UseTransportCostMatrix set to yes, but matrix not populated at /kohadevbox/koha/C4/HoldsQueue.pm line 188. It seems that they are expected, we simply need to catch them. --- .../HoldsQueue/TransportCostOptimizations.t | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/t/db_dependent/HoldsQueue/TransportCostOptimizations.t b/t/db_dependent/HoldsQueue/TransportCostOptimizations.t index b11b3ba0739..933ab22e3fd 100755 --- a/t/db_dependent/HoldsQueue/TransportCostOptimizations.t +++ b/t/db_dependent/HoldsQueue/TransportCostOptimizations.t @@ -9,7 +9,9 @@ use Modern::Perl; -use Test::More tests => 117; +use Test::More tests => 120; +use Test::NoWarnings; +use Test::Warn; use Data::Dumper; use C4::Context; @@ -214,23 +216,32 @@ sub test_allocation { $schema->txn_rollback; } - -test_allocation( - "trivial case", - [], - [], - [], - [], - 0 +warning_like( + sub { + test_allocation( + "trivial case", + [], + [], + [], + [], + 0 + ); + }, + qr{UseTransportCostMatrix set to yes, but matrix not populated} ); -test_allocation( - "unit case", - [ [0] ], - [1], - [1], - [ [ 0, 0 ] ], - 0 +warning_like( + sub { + test_allocation( + "unit case", + [ [0] ], + [1], + [1], + [ [ 0, 0 ] ], + 0 + ); + }, + qr{UseTransportCostMatrix set to yes, but matrix not populated} ); test_allocation( -- 2.34.1