Bugzilla – Attachment 41780 Details for
Bug 14702
Refactor GetReserveFee
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14702: Unit test for GetReservesFee
Bug-14702-Unit-test-for-GetReservesFee.patch (text/plain), 1.74 KB, created by
Marcel de Rooy
on 2015-08-21 11:35:54 UTC
(
hide
)
Description:
Bug 14702: Unit test for GetReservesFee
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-08-21 11:35:54 UTC
Size:
1.74 KB
patch
obsolete
>From cfc15b53e345dc72fe14a7a766b604dedaca1df8 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 21 Aug 2015 13:00:11 +0200 >Subject: [PATCH] Bug 14702: Unit test for GetReservesFee >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run the test! >--- > t/db_dependent/Reserves_GetReserveFee.t | 44 +++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > create mode 100755 t/db_dependent/Reserves_GetReserveFee.t > >diff --git a/t/db_dependent/Reserves_GetReserveFee.t b/t/db_dependent/Reserves_GetReserveFee.t >new file mode 100755 >index 0000000..d46cfb8 >--- /dev/null >+++ b/t/db_dependent/Reserves_GetReserveFee.t >@@ -0,0 +1,44 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+use Test::More tests => 3; >+ >+use C4::Reserves qw|GetReserveFee|; >+use t::lib::TestBuilder; >+ >+my $builder = t::lib::TestBuilder->new(); >+ >+# Two categories >+$builder->build({ >+ source => 'Category', >+ value => { >+ categorycode => 'XYZ1', >+ reservefee => 2.5, >+ }, >+}); >+$builder->build({ >+ source => 'Category', >+ value => { >+ categorycode => 'XYZ2', >+ reservefee => 0, >+ }, >+}); >+ >+# Two patrons >+my $patron1 = $builder->build({ >+ source => 'Borrower', >+ value => { >+ categorycode => 'XYZ1', >+ }, >+}); >+my $patron2 = $builder->build({ >+ source => 'Borrower', >+ value => { >+ categorycode => 'XYZ2', >+ }, >+}); >+ >+# Call GetReserveFee with no borrower and the two patrons >+is( GetReserveFee(), undef, 'First call without pars works fine' ); >+is( GetReserveFee( $patron1->{borrowernumber} ) > 0, 1, 'Second call should trigger some fee' ); >+is( GetReserveFee( $patron2->{borrowernumber} ), undef, 'Third call should not trigger any fee' ); >-- >1.7.10.4
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 14702
:
41779
|
41780
|
41781
|
41853
|
41854
|
41856
|
41857
|
42005
|
42006
|
42015
|
42016
|
42017
|
42153
|
42154
|
42155
|
42156
|
42165
|
42166
|
42167
|
42191