Bug 31095: Remove GetDebarments from MarkIssueReturned.t

This patch removes GetDebarments from Ciculation/MarkIssueReturned.t

Test plan
1. Confirm t/db_dependent/Circulation/MarkIssueReturned.t passes prior
   to the patch
2. Confirm t/db_dependent/Circulation/MarkIssueReturned.t passes after
   the patch
3. Confirm no tests have been removed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2022-08-25 09:11:13 +01:00 committed by Tomas Cohen Arazi
parent 07d3426ae8
commit f35fb71977
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -30,7 +30,7 @@ use Koha::Database;
use Koha::DateUtils qw(dt_from_string);
use Koha::Old::Checkouts;
use Koha::Patrons;
use Koha::Patron::Debarments qw( GetDebarments AddUniqueDebarment );
use Koha::Patron::Debarments qw( AddUniqueDebarment );
my $schema = Koha::Database->schema;
my $builder = t::lib::TestBuilder->new;
@ -199,13 +199,14 @@ subtest 'AutoRemoveOverduesRestrictions' => sub {
C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item_1->itemnumber );
my $debarments = Koha::Patron::Debarments::GetDebarments({ borrowernumber => $patron->borrowernumber });
is( $debarments->[0]->{type}, 'OVERDUES', 'OVERDUES debarment is not removed if patron still has overdues' );
my $restrictions = $patron->restrictions;
my $THE_restriction = $restrictions->next;
is( $THE_restriction->type->code, 'OVERDUES', 'OVERDUES debarment is not removed if patron still has overdues' );
C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item_2->itemnumber );
$debarments = Koha::Patron::Debarments::GetDebarments({ borrowernumber => $patron->borrowernumber });
is( scalar @$debarments, 0, 'OVERDUES debarment is removed if patron does not have overdues' );
$restrictions = $patron->restrictions;
is( $restrictions->count, 0, 'OVERDUES debarment is removed if patron does not have overdues' );
$schema->storage->txn_rollback;
};