From dfcdf18cf11f51cd1342ddb7ee21543d78c29cb1 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 8 Oct 2025 21:08:32 +0000 Subject: [PATCH] Bug 28530: Adjust tests --- t/db_dependent/Koha/Library/FloatLimits.t | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/Koha/Library/FloatLimits.t b/t/db_dependent/Koha/Library/FloatLimits.t index c64dced791b..b0d3c4da093 100755 --- a/t/db_dependent/Koha/Library/FloatLimits.t +++ b/t/db_dependent/Koha/Library/FloatLimits.t @@ -15,7 +15,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with Koha; if not, see . +# along with Koha; if not, see . use Modern::Perl; @@ -109,7 +109,8 @@ my $float_limit3 = Koha::Library::FloatLimit->new( )->store(); is( - Koha::Library::FloatLimits->lowest_ratio_library( $item, $library1->{branchcode} )->branchcode, + Koha::Library::FloatLimits->lowest_ratio_library( $item, $library1->{branchcode}, $item->holdingbranch ) + ->branchcode, $library3->{branchcode}, "Correct library selected for float limit transfer" ); @@ -137,8 +138,10 @@ subtest 'FloatLimits: General tests' => sub { itype => $builder->build_object( { class => 'Koha::ItemTypes' } )->itemtype, } ); - - my $no_limits_result = Koha::Library::FloatLimits->lowest_ratio_library( $no_limits_item, $library1->{branchcode} ); + my $no_limits_result = Koha::Library::FloatLimits->lowest_ratio_library( + $no_limits_item, $library1->{branchcode}, + $no_limits_item->holdingbranch + ); is( $no_limits_result, undef, "Returns undef when no float limits defined" ); # Test with only zero float limits @@ -163,8 +166,10 @@ subtest 'FloatLimits: General tests' => sub { itype => $unknown_itemtype->itemtype, } ); - - my $unknown_result = Koha::Library::FloatLimits->lowest_ratio_library( $unknown_item, $library1->{branchcode} ); + my $unknown_result = Koha::Library::FloatLimits->lowest_ratio_library( + $unknown_item, $library1->{branchcode}, + $unknown_item->holdingbranch + ); is( $unknown_result, undef, "Returns undef for item type not in float limits" ); $schema->storage->txn_rollback; -- 2.39.5