Bugzilla – Attachment 100229 Details for
Bug 24474
Lost items that are checked out are always returned, even when attempting to renew them
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24474: Add tests
Bug-24474-Add-tests.patch (text/plain), 2.72 KB, created by
Martin Renvoize (ashimema)
on 2020-03-06 10:15:32 UTC
(
hide
)
Description:
Bug 24474: Add tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-03-06 10:15:32 UTC
Size:
2.72 KB
patch
obsolete
>From 6f10212e9946b6e1c5e97382ae36e596b4d9aabd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 4 Feb 2020 15:13:47 +0100 >Subject: [PATCH] Bug 24474: Add tests > >This does the following using the interface: >- Unselect all the options from MarkLostItemsAsReturned except for > 'onpayment' >- Check an item out >- Create a manual invoice LOST for the checked in item >- Renew the item >- Check that the item was not returned > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Circulation.t | 44 +++++++++++++++++++++++++++++++++++- > 1 file changed, 43 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 66c3617638..54264bd071 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 46; >+use Test::More tests => 47; > use Test::MockModule; > use Test::Deep qw( cmp_deeply ); > >@@ -3742,6 +3742,48 @@ subtest "Test Backdating of Returns" => sub { > is( $accountline->amount+0, 0, 'Fee amount was reduced to 0' ); > }; > >+subtest 'Do not return on renewal (LOST charge)' => sub { >+ plan tests => 1; >+ >+ t::lib::Mocks::mock_preference('MarkLostItemsAsReturned', 'onpayment'); >+ my $library = $builder->build_object( { class => "Koha::Libraries" } ); >+ my $manager = $builder->build_object( { class => "Koha::Patrons" } ); >+ t::lib::Mocks::mock_userenv({ patron => $manager,branchcode => $manager->branchcode }); >+ >+ my $biblio = $builder->build_sample_biblio; >+ >+ my $item = $builder->build_sample_item( >+ { >+ biblionumber => $biblio->biblionumber, >+ library => $library->branchcode, >+ replacementprice => 99.00, >+ itype => $itemtype, >+ } >+ ); >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ AddIssue( $patron->unblessed, $item->barcode ); >+ >+ my $accountline = Koha::Account::Line->new( >+ { >+ borrowernumber => $patron->borrowernumber, >+ debit_type_code => 'LOST', >+ status => undef, >+ itemnumber => $item->itemnumber, >+ amount => 12, >+ amountoutstanding => 12, >+ interface => 'something', >+ } >+ )->store(); >+ >+ # AddRenewal doesn't call _FixAccountForLostAndFound >+ AddIssue( $patron->unblessed, $item->barcode ); >+ >+ is( $patron->checkouts->count, 1, >+ 'Renewal should not return the item even if a LOST payment has been made earlier' >+ ); >+}; >+ > $schema->storage->txn_rollback; > C4::Context->clear_syspref_cache(); > $cache->clear_from_cache('single_holidays'); >-- >2.20.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 24474
:
98392
|
98393
|
98436
|
98437
|
98438
|
98439
|
98460
|
98485
|
98486
|
98487
|
98645
|
98646
|
98647
|
98648
|
98673
|
98674
|
98675
|
98676
|
98923
|
100229
|
100230
|
100231
|
100232
|
100233
|
102104
|
102105
|
102106
|
102107
|
102108
|
102109
|
102110
|
102132
|
102133
|
102134
|
102135
|
102136
|
102137
|
102138