Bugzilla – Attachment 153813 Details for
Bug 29145
Allow patrons to have overdue items that would not result in debarment when removing overdue debarments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29145: Replace GetDebarments in unit tests
Bug-29145-Replace-GetDebarments-in-unit-tests.patch (text/plain), 2.65 KB, created by
Katrin Fischer
on 2023-07-21 16:36:39 UTC
(
hide
)
Description:
Bug 29145: Replace GetDebarments in unit tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-07-21 16:36:39 UTC
Size:
2.65 KB
patch
obsolete
>From 0854989e3374d1f079aca73bb3fb140fca714a83 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Fri, 21 Jul 2023 16:05:11 +0000 >Subject: [PATCH] Bug 29145: Replace GetDebarments in unit tests > >GetDebarments was removed and replaced by $patron->restrictions. >The tests needed some adjustments to reflect that change. >--- > t/db_dependent/Circulation/MarkIssueReturned.t | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Circulation/MarkIssueReturned.t b/t/db_dependent/Circulation/MarkIssueReturned.t >index cc175c6930..6eabf1ef79 100755 >--- a/t/db_dependent/Circulation/MarkIssueReturned.t >+++ b/t/db_dependent/Circulation/MarkIssueReturned.t >@@ -242,8 +242,8 @@ subtest 'AutoRemoveOverduesRestrictions' => sub { > > C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item_1->itemnumber ); > >- $debarments = Koha::Patron::Debarments::GetDebarments({ borrowernumber => $patron->borrowernumber }); >- is( scalar @$debarments, 0, 'OVERDUES debarment is removed if remaining items would not result in patron debarment' ); >+ $restrictions = $patron->restrictions; >+ is($restrictions->count, 0, 'OVERDUES debarment is removed if remaining items would not result in patron debarment' ); > > $checkout_1 = AddIssue( $patron->unblessed, $item_1->barcode, $ten_days_ago ); # overdue and would trigger debarment > >@@ -257,8 +257,8 @@ subtest 'AutoRemoveOverduesRestrictions' => sub { > > C4::Circulation::MarkIssueReturned( $patron->borrowernumber, $item_2->itemnumber ); > >- $debarments = Koha::Patron::Debarments::GetDebarments({ borrowernumber => $patron->borrowernumber }); >- is( $debarments->[0]->{type}, 'OVERDUES', 'OVERDUES debarment is not removed if patron still has overdues that would trigger debarment' ); >+ $restrictions = $patron->restrictions->search({ type => 'OVERDUES' }); >+ is( $restrictions->count, 1, 'OVERDUES debarment is not removed if patron still has overdues that would trigger debarment' ); > > my $eleven_days_ago = dt_from_string->subtract( days => 11 ); > >@@ -282,8 +282,8 @@ subtest 'AutoRemoveOverduesRestrictions' => sub { > > 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 remaining items would not result in patron debarment' ); >+ $restrictions = $patron->restrictions; >+ is( $restrictions->count, 0, 'OVERDUES debarment is removed if remaining items would not result in patron debarment' ); > > $schema->storage->txn_rollback; > }; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29145
:
125495
|
140819
|
140820
|
141822
|
141823
|
142394
|
142395
|
142396
|
142814
|
142815
|
142816
|
142817
|
143213
|
144773
|
144774
|
144775
|
144776
|
144777
|
144778
|
144779
|
144780
|
144781
|
144782
|
145720
|
145749
|
145750
|
145751
|
153804
|
153805
|
153806
|
153807
|
153808
|
153809
|
153810
|
153811
|
153812
|
153813
|
153814
|
156392
|
156393
|
156394
|
156395
|
156396
|
156397
|
156398
|
156399
|
156400
|
156401
|
156402
|
156403
|
156404