Bugzilla – Attachment 152924 Details for
Bug 34101
Limit items types that can be checked out via SIP2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34101: Unit Tests
Bug-34101-Unit-Tests.patch (text/plain), 2.13 KB, created by
Martin Renvoize (ashimema)
on 2023-07-03 10:30:01 UTC
(
hide
)
Description:
Bug 34101: Unit Tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-07-03 10:30:01 UTC
Size:
2.13 KB
patch
obsolete
>From 4cad9a17d4ea6e8793e912dfcc92ae4fccd80bb5 Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Tue, 27 Jun 2023 22:54:54 +0000 >Subject: [PATCH] Bug 34101: Unit Tests > >prove t/db_dependent/SIP/Message.t > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/SIP/Message.t | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index f9a80b91a6..3da7edc4c2 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -71,7 +71,7 @@ subtest 'Testing Patron Info Request V2' => sub { > subtest 'Checkout V2' => sub { > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >- plan tests => 5; >+ plan tests => 8; > $C4::SIP::Sip::protocol_version = 2; > test_checkout_v2(); > $schema->storage->txn_rollback; >@@ -824,6 +824,24 @@ sub test_checkout_v2 { > $msg->handle_checkout( $server ); > ok( $response =~ m/AH\d{4}-\d{2}-\d{2}/, "Found AH field as SQL date in response"); > >+ #returning item and now testing for blocked_item_types >+ t::lib::Mocks::mock_preference( 'CheckPrevCheckout', 'hardno' ); >+ AddReturn($item_object->barcode, $branchcode); >+ >+ $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >+ $server->{account}->{blocked_item_types} = "CR|".$item_object->itype; >+ $msg->handle_checkout( $server ); >+ $respcode = substr( $response, 0, 2 ); >+ check_field( $respcode, $response, FID_SCREEN_MSG, 'Item type cannot be checked out at this checkout location', 'Check screen msg', 'equals' ); >+ >+ is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 0, "Item was not checked out (item type matched blocked_item_types)"); >+ >+ $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >+ $server->{account}->{blocked_item_types} = ""; >+ $msg->handle_checkout( $server ); >+ $respcode = substr( $response, 0, 2 ); >+ is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was checked out successfully"); >+ > } > > sub test_checkin_v2 { >-- >2.41.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 34101
:
152773
|
152774
|
152798
|
152799
| 152924 |
152925