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.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 364b78e653)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 66c969e037)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2025-07-15 12:09:47 +02:00 committed by Fridolin Somers
parent c29a9e67a8
commit d9eeb0c341
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
1 changed files with 27 additions and 16 deletions

View File

@ -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(