Bugzilla – Attachment 107640 Details for
Bug 26108
Checkins should not require item to have been checked out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26108: Regression tests
Bug-26108-Regression-tests.patch (text/plain), 1.97 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-07-31 12:56:07 UTC
(
hide
)
Description:
Bug 26108: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-07-31 12:56:07 UTC
Size:
1.97 KB
patch
obsolete
>From 7e1dde5675c9892bbba47b441225ec8d1e34498e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 31 Jul 2020 09:47:56 -0300 >Subject: [PATCH] Bug 26108: Regression tests > >The current implementation makes the assumption that if $issue is >defined, then it is the 'return' use case. This is correct, but >incomplete: after verifying that there's actually an issue, the return >can be rejected for various reasons. > >This patch introduces a regression test for one of those situations >(which I consider enough for testing purposes) . It highlights that the >hook shouldn't be called if there hasn't been an actual checkin. > >To test: >1. Apply this patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Plugins/Circulation_hooks.t >=> FAIL: Tests fail because there's an unexpected warining printed by >the erroneous plugin call (i.e. there's been no return but the plugin is >called anyway). > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Plugins/Circulation_hooks.t | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Plugins/Circulation_hooks.t b/t/db_dependent/Koha/Plugins/Circulation_hooks.t >index be0f7077e9..5f8569d9ed 100755 >--- a/t/db_dependent/Koha/Plugins/Circulation_hooks.t >+++ b/t/db_dependent/Koha/Plugins/Circulation_hooks.t >@@ -92,7 +92,17 @@ subtest 'after_circ_action() hook tests' => sub { > }; > > subtest 'AddReturn' => sub { >- plan tests => 1; >+ plan tests => 2; >+ >+ t::lib::Mocks::mock_preference('BlockReturnOfWithdrawnItems', 1); >+ $item_1->set({ withdrawn => 1 })->store; >+ >+ warning_is { >+ AddReturn( $item_1->barcode, $patron->branchcode ); >+ } undef, 'No hook called because no return happened'; >+ >+ t::lib::Mocks::mock_preference('BlockReturnOfWithdrawnItems', 0); >+ $item_1->set({ withdrawn => 0 })->store; > > warning_like { > AddReturn( $item_1->barcode, $patron->branchcode ); >-- >2.28.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 26108
:
107618
| 107640 |
107641