Bugzilla – Attachment 66670 Details for
Bug 19198
Renewal as issue causes too many error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19198 - Unit tests
Bug-19198---Unit-tests.patch (text/plain), 2.95 KB, created by
Lee Jamison
on 2017-08-31 13:23:38 UTC
(
hide
)
Description:
Bug 19198 - Unit tests
Filename:
MIME Type:
Creator:
Lee Jamison
Created:
2017-08-31 13:23:38 UTC
Size:
2.95 KB
patch
obsolete
>From be4d9b844792ded2292ff78fc4eb57adad4d27d2 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 29 Aug 2017 14:10:54 +0000 >Subject: [PATCH] Bug 19198 - Unit tests > >Signed-off-by: Lee Jamison <ldjamison@marywood.edu> >--- > t/db_dependent/Circulation.t | 55 +++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 54 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 361637e..2bf8a98 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 98; >+use Test::More tests => 99; > > use DateTime; > >@@ -1716,6 +1716,59 @@ subtest 'AddReturn | is_overdue' => sub { > > }; > >+subtest 'AddReturn | is_overdue' => sub { >+ plan tests => 3; >+ >+# Set a simple circ policy >+$dbh->do('DELETE FROM issuingrules'); >+$dbh->do( >+ q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed, >+ maxissueqty, issuelength, lengthunit, >+ renewalsallowed, renewalperiod, >+ norenewalbefore, auto_renew, >+ fine, chargeperiod) >+ VALUES (?, ?, ?, ?, >+ ?, ?, ?, >+ ?, ?, >+ ?, ?, >+ ?, ? >+ ) >+ }, >+ {}, >+ '*', '*', '*', 25, >+ 1, 14, 'days', >+ 1, 7, >+ undef, 0, >+ .10, 1 >+); >+ my $five_days_go = output_pref({ dt => dt_from_string->add( days => 5 ), dateonly => 1}); >+ my $ten_days_go = output_pref({ dt => dt_from_string->add( days => 10), dateonly => 1 }); >+ my $library = $builder->build( { source => 'Branch' } ); >+ my $patron = $builder->build( { source => 'Borrower' } ); >+ >+ my $biblioitem = $builder->build( { source => 'Biblioitem' } ); >+ my $item = $builder->build( >+ { >+ source => 'Item', >+ value => { >+ homebranch => $library->{branchcode}, >+ holdingbranch => $library->{branchcode}, >+ notforloan => 0, >+ itemlost => 0, >+ withdrawn => 0, >+ biblionumber => $biblioitem->{biblionumber}, >+ } >+ } >+ ); >+ my $issue = AddIssue( $patron, $item->{barcode}, $five_days_go ); # date due was 10d ago >+ my $actualissue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); >+ is( output_pref({ str => $actualissue->date_due, dateonly => 1}), $five_days_go, "First issue works"); >+ my ($issuingimpossible, $needsconfirmation) = CanBookBeIssued($patron,$item->{barcode},$ten_days_go, undef, undef, undef); >+ is( $needsconfirmation->{RENEW_ISSUE}, 1, "This is a renewal"); >+ is( $needsconfirmation->{TOO_MANY}, undef, "Not too many, is a renewal"); >+ >+}; >+ > sub set_userenv { > my ( $library ) = @_; > C4::Context->set_userenv(0,0,0,'firstname','surname', $library->{branchcode}, $library->{branchname}, '', '', ''); >-- >2.1.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 19198
:
66584
|
66585
|
66670
|
66671
|
67111
|
67112
|
67113
|
67567
|
67568
|
67569
|
67571
|
67572
|
67573
|
67719
|
67720