From e6de47e9ecdf01190c7a244e30cb760281554f38 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 17 Oct 2023 11:51:24 -0300 Subject: [PATCH] Bug 30719: Remove unused Koha::Illbatch->requests_count method This patch removes this stray method from the original implementation. To test: 1. Apply this patch 2. Run: $ git grep requests_count => SUCCESS: Notice the only ILL-related mantions are API related, which is returned by using the 'requests+count' embed, which is unrelated to this particular method 3. Run: $ prove t/db_dependent/api/v1/ill_batches.t \ t/db_dependent/Illbatches.t => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi --- Koha/Illbatch.pm | 13 ------------- t/db_dependent/Illbatches.t | 8 +------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/Koha/Illbatch.pm b/Koha/Illbatch.pm index a44c344731..31048670f6 100644 --- a/Koha/Illbatch.pm +++ b/Koha/Illbatch.pm @@ -79,19 +79,6 @@ sub library { return Koha::Library->_new_from_dbic($library); } -=head3 requests_count - - my $requests_count = Koha::Illbatch->requests_count; - -Return the number of requests associated with this batch - -=cut - -sub requests_count { - my ($self) = @_; - return Koha::Illrequests->search( { batch_id => $self->id } )->count; -} - =head3 requests Return the I for this batch diff --git a/t/db_dependent/Illbatches.t b/t/db_dependent/Illbatches.t index 18f79bab9b..d0c465217a 100755 --- a/t/db_dependent/Illbatches.t +++ b/t/db_dependent/Illbatches.t @@ -27,7 +27,7 @@ use t::lib::TestBuilder; use Test::MockObject; use Test::MockModule; -use Test::More tests => 7; +use Test::More tests => 6; my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; @@ -36,8 +36,6 @@ use_ok('Koha::Illbatches'); $schema->storage->txn_begin; -Koha::Illrequests->search->delete; - # Create a patron my $patron = $builder->build( { source => 'Borrower' } ); @@ -77,10 +75,6 @@ my $illrq = $builder->build( ); my $illrq_obj = Koha::Illrequests->find( $illrq->{illrequest_id} ); -# Check requests_count -my $requests_count = $illbatch->requests_count; -is( $requests_count, 1, 'requests_count returns correctly' ); - # Check patron my $batch_patron = $illbatch->patron; isa_ok( $batch_patron, 'Koha::Patron' ); -- 2.39.5