Bugzilla – Attachment 106809 Details for
Bug 14784
Missing checkin message for debarred patrons when issuing rules 'fine days = 0'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14784: Add tests
Bug-14784-Add-tests.patch (text/plain), 2.53 KB, created by
Maryse Simard
on 2020-07-13 04:11:06 UTC
(
hide
)
Description:
Bug 14784: Add tests
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2020-07-13 04:11:06 UTC
Size:
2.53 KB
patch
obsolete
>From 32eca336a5cea11e0a921bc98a674cb0f6dcf1ee Mon Sep 17 00:00:00 2001 >From: Maryse Simard <maryse.simard@inlibro.com> >Date: Sun, 12 Jul 2020 23:58:30 -0400 >Subject: [PATCH] Bug 14784: Add tests > >This patch adds tests for PrevDebarred message of AddReturn when finesdays = 0. > >To test: >1. Apply patches >2. prove -v t/db_dependent/Circulation.t > >When applying only this patch, one test should fail. >--- > t/db_dependent/Circulation.t | 31 ++++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index e9f28b55d9..bdd6153f94 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2102,7 +2102,7 @@ subtest 'AddReturn + CumulativeRestrictionPeriods' => sub { > }; > > subtest 'AddReturn + suspension_chargeperiod' => sub { >- plan tests => 24; >+ plan tests => 26; > > my $library = $builder->build( { source => 'Branch' } ); > my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); >@@ -2300,6 +2300,35 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > } > ); > >+ # Debarred message when finesdays = 0 >+ >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ itemtype => undef, >+ rules => { >+ finedays => 0, >+ suspension_chargeperiod => 1, >+ } >+ } >+ ); >+ >+ Koha::Patron::Debarments::AddDebarment( { borrowernumber => $patron->{borrowernumber}, type => 'MANUAL', expiration => $now->clone->add(days => 10) } ); >+ >+ AddIssue( $patron, $item_1->{barcode}, $now->clone->add(days => 1) ); >+ >+ my ( undef, $message ) = AddReturn( $item_1->{barcode}, $library->{branchcode}, undef, $now->clone->subtract(days => 1) ); >+ is( $message->{WasReturned} && exists $message->{PrevDebarred}, 1, 'Previously debarred message for AddReturn when not overdue' ); >+ >+ AddIssue( $patron, $item_1->{barcode}, $now->clone->add(days => 1) ); >+ >+ ( undef, $message ) = AddReturn( $item_1->{barcode}, $library->{branchcode}, undef, $now->clone->add(days => 5) ); >+ is( $message->{WasReturned} && exists $message->{PrevDebarred}, 1, 'Previously debarred message for AddReturn when overdue' ); >+ >+ Koha::Patron::Debarments::DelUniqueDebarment( >+ { borrowernumber => $patron->{borrowernumber}, type => 'MANUAL' } ); >+ > }; > > subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { >-- >2.17.1
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 14784
:
42354
|
49282
|
49283
|
49377
|
58227
|
67102
|
68132
|
69295
|
69296
|
77683
|
79826
|
106808
|
106809
|
107487
|
110485
|
110514
|
110763
|
110764
|
112724
|
112725
|
136040
|
136327
|
137727
|
137728
|
145320
|
145321