Bugzilla – Attachment 68312 Details for
Bug 19487
Internal server error when writing off lost fine for item not checked out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19487: Fix MarkIssueReturned.t
Bug-19487-Fix-MarkIssueReturnedt.patch (text/plain), 3.15 KB, created by
Marcel de Rooy
on 2017-10-20 07:56:36 UTC
(
hide
)
Description:
Bug 19487: Fix MarkIssueReturned.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-10-20 07:56:36 UTC
Size:
3.15 KB
patch
obsolete
>From 018f43c8f0821b40d3c636a9fcea93d52767f98f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 19 Oct 2017 09:02:20 -0300 >Subject: [PATCH] Bug 19487: Fix MarkIssueReturned.t >Content-Type: text/plain; charset=utf-8 > >MarkIssueReturned must now return directly if the issue does not exist. >We then check if the anonymous patron configuration is correct. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Circulation/MarkIssueReturned.t | 33 +++++++++++++++++++++----- > 1 file changed, 27 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/Circulation/MarkIssueReturned.t b/t/db_dependent/Circulation/MarkIssueReturned.t >index 7fc7f14..69b1b72 100644 >--- a/t/db_dependent/Circulation/MarkIssueReturned.t >+++ b/t/db_dependent/Circulation/MarkIssueReturned.t >@@ -36,20 +36,41 @@ my $builder = t::lib::TestBuilder->new; > > t::lib::Mocks::mock_preference('AnonymousPatron', ''); > >-my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode }; >+my $library = $builder->build({ source => 'Branch' }); > my $categorycode = $builder->build({ source => 'Category' })->{ categorycode }; > >+C4::Context->_new_userenv('xxx'); >+C4::Context->set_userenv(0,0,0,'firstname','surname', $library->{branchcode}, $library->{branchname}, '', '', ''); >+ > my %item_branch_infos = ( >- homebranch => $branchcode, >- holdingbranch => $branchcode, >+ homebranch => $library->{branchcode}, >+ holdingbranch => $library->{branchcode}, > ); > >-my $borrowernumber = AddMember( categorycode => $categorycode, branchcode => $branchcode ); >+my $borrowernumber = AddMember( categorycode => $categorycode, branchcode => $library->{branchcode} ); >+my $patron_category = $builder->build({ source => 'Category', value => { categorycode => 'NOT_X', category_type => 'P', enrolmentfee => 0 } }); >+ my $patron = $builder->build({ source => 'Borrower', value => { branchcode => $library->{branchcode}, categorycode => $patron_category->{categorycode} } } ); >+ >+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}, >+ } >+ } >+); >+C4::Circulation::AddIssue( $patron, $item->{barcode} ); > >-eval { C4::Circulation::MarkIssueReturned( $borrowernumber, 'itemnumber', 'dropbox_branch', 'returndate', 2 ) }; >+eval { C4::Circulation::MarkIssueReturned( $borrowernumber, $item->{itemnumber}, 'dropbox_branch', 'returndate', 2 ) }; > like ( $@, qr<Fatal error: the patron \(\d+\) .* AnonymousPatron>, ); > >-my $anonymous_borrowernumber = AddMember( categorycode => $categorycode, branchcode => $branchcode ); >+my $anonymous_borrowernumber = AddMember( categorycode => $categorycode, branchcode => $library->{branchcode} ); > t::lib::Mocks::mock_preference('AnonymousPatron', $anonymous_borrowernumber); > # The next call will raise an error, because data are not correctly set > $dbh->{PrintError} = 0; >-- >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 19487
:
68275
|
68293
|
68294
| 68312 |
68313
|
68314
|
68330