Bugzilla – Attachment 140727 Details for
Bug 31095
Remove Koha::Patron::Debarment::GetDebarments and use $patron->restrictions in preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31095: Remove GetDebarments from MarkIssueReturned.t
Bug-31095-Remove-GetDebarments-from-MarkIssueRetur.patch (text/plain), 2.34 KB, created by
Nick Clemens (kidclamp)
on 2022-09-16 16:09:41 UTC
(
hide
)
Description:
Bug 31095: Remove GetDebarments from MarkIssueReturned.t
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-09-16 16:09:41 UTC
Size:
2.34 KB
patch
obsolete
>From ef371506d1d4067dfb3b7f518b1c17d749c3a158 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 25 Aug 2022 09:11:13 +0100 >Subject: [PATCH] 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> >--- > t/db_dependent/Circulation/MarkIssueReturned.t | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Circulation/MarkIssueReturned.t b/t/db_dependent/Circulation/MarkIssueReturned.t >index 654ac37451..fc939a2486 100755 >--- a/t/db_dependent/Circulation/MarkIssueReturned.t >+++ b/t/db_dependent/Circulation/MarkIssueReturned.t >@@ -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; > }; >-- >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 31095
:
139614
|
139719
|
139720
|
139721
|
139722
|
139723
|
139724
|
139725
|
139726
|
139727
|
139728
|
139742
|
139743
|
139744
|
139745
|
139746
|
139747
|
139748
|
139749
|
139750
|
139751
|
139752
|
139753
|
139754
|
139755
|
139756
|
139757
|
139758
|
140714
|
140715
|
140716
|
140717
|
140718
|
140719
|
140720
|
140721
|
140722
|
140723
|
140724
|
140725
|
140726
|
140727
|
140728
|
140729
|
140730
|
140731
|
142059
|
142060
|
142061
|
142062
|
142063
|
142064
|
142065
|
142066
|
142067
|
142068
|
142069
|
142070
|
142071
|
142072
|
142073
|
142074
|
142075
|
142076
|
143745
|
143746
|
143747
|
143748
|
143749
|
143750
|
143751
|
143752
|
143753
|
143754
|
143755
|
143756
|
143757
|
143758
|
143759
|
143760
|
143761
|
143762
|
143763
|
144903
|
144904
|
144905
|
144906
|
144907
|
144908
|
144909
|
144910
|
144911
|
144912
|
144913
|
144914
|
144915
|
144916
|
144917
|
144918
|
144919
|
144920
|
144921
|
145800
|
145801
|
145803
|
145845