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 <tomascohen@theke.io>
This commit is contained in:
Tomás Cohen Arazi 2023-10-17 11:51:24 -03:00
parent f51f1265a1
commit e6de47e9ec
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 1 additions and 20 deletions

View file

@ -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<Koha::Illrequests> for this batch

View file

@ -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' );