Bugzilla – Attachment 45523 Details for
Bug 14945
Add the ability to store the last patron to return an item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14945: Add 2 more tests for StoreLastBorrower
Bug-14945-Add-2-more-tests-for-StoreLastBorrower.patch (text/plain), 2.22 KB, created by
Jonathan Druart
on 2015-12-09 10:31:02 UTC
(
hide
)
Description:
Bug 14945: Add 2 more tests for StoreLastBorrower
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-09 10:31:02 UTC
Size:
2.22 KB
patch
obsolete
>From 9fe2b5777355356abc46e69cbf92dfbbd17dad20 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 9 Dec 2015 10:24:15 +0000 >Subject: [PATCH] Bug 14945: Add 2 more tests for StoreLastBorrower > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Circulation/AnonymiseIssueHistory.t | 28 +++++++++++++++++++++- > 1 file changed, 27 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/AnonymiseIssueHistory.t b/t/db_dependent/Circulation/AnonymiseIssueHistory.t >index 87049ad..5735f86 100644 >--- a/t/db_dependent/Circulation/AnonymiseIssueHistory.t >+++ b/t/db_dependent/Circulation/AnonymiseIssueHistory.t >@@ -164,7 +164,7 @@ subtest 'AnonymousPatron is not defined' => sub { > }; > > subtest 'Test StoreLastBorrower' => sub { >- plan tests => 4; >+ plan tests => 6; > > t::lib::Mocks::mock_preference( 'StoreLastBorrower', '1' ); > >@@ -241,6 +241,32 @@ subtest 'Test StoreLastBorrower' => sub { > my $patron_object2 = $item_object->last_returned_by(); > is( $patron_object->id, $patron_object2->id, > 'Calling last_returned_by with Borrower object sets last_returned_by to that borrower' ); >+ >+ $patron_object->delete; >+ $item_object = Koha::Items->find( $item->{itemnumber} ); >+ is( $item_object->last_returned_by, undef, 'last_returned_by should return undef if the last patron to return the item has been deleted' ); >+ >+ t::lib::Mocks::mock_preference( 'StoreLastBorrower', '0' ); >+ $patron = $builder->build( >+ { >+ source => 'Borrower', >+ value => { privacy => 1, } >+ } >+ ); >+ >+ $issue = $builder->build( >+ { >+ source => 'Issue', >+ value => { >+ borrowernumber => $patron->{borrowernumber}, >+ itemnumber => $item->{itemnumber}, >+ }, >+ } >+ ); >+ ( $returned, undef, undef ) = C4::Circulation::AddReturn( $item->{barcode}, undef, undef, undef, '2010-10-10' ); >+ >+ $item_object = Koha::Items->find( $item->{itemnumber} ); >+ is( $item_object->last_returned_by, undef, 'Last patron to return item should not be stored if StoreLastBorrower if off' ); > }; > > $schema->storage->txn_rollback; >-- >2.1.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 14945
:
43073
|
43074
|
43075
|
43077
|
44075
|
45147
|
45466
|
45510
|
45511
|
45522
| 45523