Bugzilla – Attachment 131555 Details for
Bug 29936
Add ability to disable hold capture via SIP checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29936: Add unit tests
Bug-29936-Add-unit-tests.patch (text/plain), 2.51 KB, created by
Martin Renvoize (ashimema)
on 2022-03-10 13:55:17 UTC
(
hide
)
Description:
Bug 29936: Add unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-10 13:55:17 UTC
Size:
2.51 KB
patch
obsolete
>From 467924b548957ee5f6db08384f7d42489395c5ba Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 10 Mar 2022 13:51:58 +0000 >Subject: [PATCH] Bug 29936: Add unit tests > >This patch adds a unit test for the new functionality introduced with >holds_get_captured allowing for holds to still be highlighted to patrons >at checkin but not mark them as found/transfered in the system. >--- > t/db_dependent/SIP/Message.t | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index bc13c3bf25..c43a3fdc6c 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -80,7 +80,7 @@ subtest 'Checkout V2' => sub { > subtest 'Checkin V2' => sub { > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >- plan tests => 35; >+ plan tests => 39; > $C4::SIP::Sip::protocol_version = 2; > test_checkin_v2(); > $schema->storage->txn_rollback; >@@ -813,11 +813,23 @@ sub test_checkin_v2 { > $msg->handle_checkin( $server ); > is( substr($response,2,1), '0', 'OK flag is false when we check in an item on hold and we do not allow it' ); > is( substr($response,5,1), 'Y', 'Alert flag is set' ); >- check_field( $respcode, $response, FID_SCREEN_MSG, 'Item is on hold, please return to circulation desk', 'Screen message is correct' ); > is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was not checked in"); >- $hold->delete(); >+ $hold->discard_changes; >+ is( $hold->found, undef, "Hold was not marked as found by SIP when holds_block_checkin enabled"); > $server->{account}->{holds_block_checkin} = 0; > >+ # Test account option holds_get_captured that automatically sets the hold as found for a hold and possibly sets it to in transit >+ $server->{account}->{holds_get_captured} = 0; >+ undef $response; >+ $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >+ $msg->handle_checkin( $server ); >+ is( substr($response,2,1), '1', 'OK flag is true when we check in an item on hold and we allow it but do not capture it' ); >+ is( substr($response,5,1), 'Y', 'Alert flag is set' ); >+ is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 0, "Item was checked in"); >+ $hold->discard_changes; >+ is( $hold->found, undef, "Hold was not marked as found by SIP when holds_get_captured disabled"); >+ $hold->delete(); >+ $server->{account}->{holds_get_captured} = 1; > } > > sub test_hold_patron_bcode { >-- >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 29936
:
131555
|
131556
|
131575
|
131576
|
131577
|
131578
|
133763
|
133764
|
133765