Bugzilla – Attachment 97859 Details for
Bug 23443
Paying off a lost fee will return the item, even if it is checked out to a different patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23443: Add tests
Bug-23443-Add-tests.patch (text/plain), 2.59 KB, created by
Marcel de Rooy
on 2020-01-24 08:49:07 UTC
(
hide
)
Description:
Bug 23443: Add tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-01-24 08:49:07 UTC
Size:
2.59 KB
patch
obsolete
>From 88c16dfee3c6db1d79a0bf10b08e4047627c0a39 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 14 Jan 2020 12:39:36 +0100 >Subject: [PATCH] Bug 23443: Add tests >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Koha/Account.t | 45 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 44 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index 85ddb5eb50..5437f16403 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -712,7 +712,7 @@ subtest 'pay() tests' => sub { > > subtest 'pay() handles lost items when paying a specific lost fee' => sub { > >- plan tests => 4; >+ plan tests => 5; > > $schema->storage->txn_begin; > >@@ -780,6 +780,49 @@ subtest 'pay() handles lost items when paying a specific lost fee' => sub { > $checkout = Koha::Checkouts->find( $checkout->id ); > ok( !$checkout, 'Item was removed from patron account' ); > >+ subtest 'item was not checked out to the same patron' => sub { >+ plan tests => 1; >+ >+ my $patron_2 = $builder->build_object( >+ { >+ class => 'Koha::Patrons', >+ value => { branchcode => $library->branchcode } >+ } >+ ); >+ $item->itemlost('1')->store(); >+ C4::Accounts::chargelostitem( $patron->borrowernumber, $item->itemnumber, 5, "lost" ); >+ my $accountline = Koha::Account::Lines->search( >+ { >+ borrowernumber => $patron->borrowernumber, >+ itemnumber => $item->itemnumber, >+ debit_type_code => 'LOST' >+ } >+ )->next; >+ my $checkout = Koha::Checkout->new( >+ { >+ borrowernumber => $patron_2->borrowernumber, >+ itemnumber => $item->itemnumber, >+ date_due => \'NOW()', >+ branchcode => $patron_2->branchcode, >+ issuedate => \'NOW()', >+ } >+ )->store(); >+ >+ $patron->account->pay( >+ { >+ amount => 5, >+ library_id => $library->branchcode, >+ lines => [$accountline], >+ } >+ ); >+ >+ ok( >+ Koha::Checkouts->find( $checkout->issue_id ), >+ 'If the item is checked out to another patron, a lost item should not be returned if lost fee is paid' >+ ); >+ >+ }; >+ > $schema->storage->txn_rollback; > }; > >-- >2.11.0
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 23443
:
97342
|
97343
|
97362
|
97363
| 97859 |
97860