Bugzilla – Attachment 149769 Details for
Bug 33210
(Bug 31963 follow-up) No hold fee message on OPAC should be displayed when there is no fee
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33210: Add unit test
Bug-33210-Add-unit-test.patch (text/plain), 2.26 KB, created by
Nick Clemens (kidclamp)
on 2023-04-17 18:41:33 UTC
(
hide
)
Description:
Bug 33210: Add unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-04-17 18:41:33 UTC
Size:
2.26 KB
patch
obsolete
>From 65a960e7222708caa0270785003d9d890ccfc182 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Fri, 24 Mar 2023 17:17:20 +0100 >Subject: [PATCH] Bug 33210: Add unit test > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Nick <nick@bywatersolutions.com> >--- > t/db_dependent/Reserves/GetReserveFee.t | 19 ++++++++++++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves/GetReserveFee.t b/t/db_dependent/Reserves/GetReserveFee.t >index 958e6c3527..ce00290c0b 100755 >--- a/t/db_dependent/Reserves/GetReserveFee.t >+++ b/t/db_dependent/Reserves/GetReserveFee.t >@@ -52,6 +52,13 @@ $builder->build({ > reservefee => 2, > }, > }); >+$builder->build({ >+ source => 'Category', >+ value => { >+ categorycode => 'XYZ2', >+ reservefee => 0, >+ }, >+}); > my $patron1 = $builder->build({ > source => 'Borrower', > value => { >@@ -67,6 +74,12 @@ my $patron2 = $builder->build({ > my $patron3 = $builder->build({ > source => 'Borrower', > }); >+my $patron4 = $builder->build({ >+ source => 'Borrower', >+ value => { >+ categorycode => 'XYZ2', >+ }, >+}); > > # One biblio and two items > my $biblio = $builder->build_sample_biblio; >@@ -84,7 +97,7 @@ my $item2 = $builder->build_sample_item( > ); > > subtest 'GetReserveFee' => sub { >- plan tests => 5; >+ plan tests => 6; > > C4::Circulation::AddIssue( $patron1, $item1->barcode, '2015-12-31', 0, undef, 0, {} ); # the date does not really matter > C4::Circulation::AddIssue( $patron3, $item2->barcode, '2015-12-31', 0, undef, 0, {} ); # the date does not really matter >@@ -109,6 +122,10 @@ subtest 'GetReserveFee' => sub { > t::lib::Mocks::mock_preference('HoldFeeMode', 'any_time_is_collected'); > $fee = C4::Reserves::GetReserveFee( $patron2->{borrowernumber}, $biblio->biblionumber ); > is( int($fee), 2, 'HoldFeeMode=any_time_is_collected, Patron 2 should be charged' ); >+ >+ t::lib::Mocks::mock_preference('HoldFeeMode', 'any_time_is_placed'); >+ $fee = C4::Reserves::GetReserveFee( $patron4->{borrowernumber}, $biblio->biblionumber ); >+ is( $fee, 0, 'HoldFeeMode=any_time_is_placed ; fee == 0, Patron 4 should not be charged' ); > }; > > subtest 'Integration with AddReserve' => sub { >-- >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 33210
:
148120
|
148149
|
148676
|
149144
|
149145
| 149769 |
149770