From b2971917e0fd4148e12b750f8d185c8f0f4bcf7d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 3 Feb 2020 13:36:54 +0100 Subject: [PATCH] Bug 24440: Rename current_holds with current_item_level_holds Signed-off-by: Jonathan Druart --- Koha/Acquisition/Order.pm | 8 ++++---- t/db_dependent/Koha/Acquisition/Order.t | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm index 55d720fcc4..e553386652 100644 --- a/Koha/Acquisition/Order.pm +++ b/Koha/Acquisition/Order.pm @@ -177,18 +177,18 @@ sub subscription { return Koha::Subscription->_new_from_dbic( $subscription_rs ); } -=head3 current_holds +=head3 current_item_level_holds - my $holds = $order->current_holds; + my $holds = $order->current_item_level_holds; -Returns the current holds associated to the order. It returns a I +Returns the current item-level holds associated to the order. It returns a I resultset in scalar context or a list of I objects in list context. It returns B if no I or no I are linked to the order. =cut -sub current_holds { +sub current_item_level_holds { my ($self) = @_; my $items_rs = $self->_result->aqorders_items; diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t index 77476eb228..5d2a1bd5ca 100644 --- a/t/db_dependent/Koha/Acquisition/Order.t +++ b/t/db_dependent/Koha/Acquisition/Order.t @@ -283,7 +283,7 @@ subtest 'duplicate_to | add_item' => sub { $schema->storage->txn_rollback; }; -subtest 'current_holds() tests' => sub { +subtest 'current_item_level_holds() tests' => sub { plan tests => 3; @@ -328,16 +328,16 @@ subtest 'current_holds() tests' => sub { } ); - is( $order->current_holds, undef, 'Returns undef if no linked biblio'); + is( $order->current_item_level_holds, undef, 'Returns undef if no linked biblio'); $order->set({ biblionumber => $biblio->biblionumber })->store->discard_changes; - is( $order->current_holds, undef, 'Returns undef if no linked items'); + is( $order->current_item_level_holds, undef, 'Returns undef if no linked items'); $order->add_item( $item_2->itemnumber ); $order->add_item( $item_3->itemnumber ); - is( $order->current_holds->count, 1, 'Only current (not future) holds are returned'); + is( $order->current_item_level_holds->count, 1, 'Only current (not future) holds are returned'); $schema->storage->txn_rollback; }; -- 2.11.0