Bugzilla – Attachment 91323 Details for
Bug 23057
If checked_in_ok is set and item is not checked out, alert flag is supressed for *any* reason
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23057: Unit tests
Bug-23057-Unit-tests.patch (text/plain), 3.07 KB, created by
Marcel de Rooy
on 2019-07-05 08:43:25 UTC
(
hide
)
Description:
Bug 23057: Unit tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-07-05 08:43:25 UTC
Size:
3.07 KB
patch
obsolete
>From aa7891fcb58e2efb9310b327612dace9052a4322 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 6 Jun 2019 10:37:11 -0400 >Subject: [PATCH] Bug 23057: Unit tests >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Matha Fuerst <mfuerst@hmcpl.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/SIP/Message.t | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index 23d9be8cef..2cdeba73d6 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -67,7 +67,7 @@ subtest 'Testing Patron Info Request V2' => sub { > subtest 'Checkin V2' => sub { > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >- plan tests => 27; >+ plan tests => 29; > $C4::SIP::Sip::protocol_version = 2; > test_checkin_v2(); > $schema->storage->txn_rollback; >@@ -302,7 +302,8 @@ sub test_request_patron_info_v2 { > > sub test_checkin_v2 { > my $builder = t::lib::TestBuilder->new(); >- my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; >+ my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; >+ my $branchcode2 = $builder->build({ source => 'Branch' })->{branchcode}; > my ( $response, $findpatron ); > my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); > >@@ -320,6 +321,7 @@ sub test_checkin_v2 { > source => 'Item', > value => { damaged => 0, withdrawn => 0, itemlost => 0, restricted => 0, homebranch => $branchcode, holdingbranch => $branchcode }, > }); >+ my $item_object = Koha::Items->find( $item->{itemnumber} ); > > my $mockILS = $mocks->{ils}; > my $server = { ils => $mockILS, account => {} }; >@@ -370,9 +372,18 @@ sub test_checkin_v2 { > is( substr($response,2,1), '1', 'OK flag is true now with checked_in_ok flag set when checking in an item that was not checked out' ); > is( substr($response,5,1), 'N', 'Alert flag no longer set' ); > check_field( $respcode, $response, FID_SCREEN_MSG, undef, 'No screen msg' ); >- $server->{account}->{checked_in_ok} = 0; > >- $server->{account}->{checked_in_ok} = 1; >+ # Move item to another holding branch to trigger CV of 04 with alert flag >+ t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'holdingbranch' ); >+ $item_object->holdingbranch( $branchcode2 )->store(); >+ undef $response; >+ $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >+ $msg->handle_checkin( $server ); >+ is( substr($response,5,1), 'Y', 'Alert flag is set with check_in_ok, item is checked in but needs transfer' ); >+ check_field( $respcode, $response, FID_ALERT_TYPE, '04', 'Got FID_ALERT_TYPE (CV) field with value 04 ( needs transfer )' ); >+ $item_object->holdingbranch( $branchcode )->store(); >+ t::lib::Mocks::mock_preference( ' AllowReturnToBranch ', 'anywhere' ); >+ > $server->{account}->{cv_send_00_on_success} = 0; > undef $response; > $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >-- >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 23057
:
90344
|
90377
|
90384
|
90385
|
90388
|
90479
|
90480
|
90505
|
90506
|
90507
|
90508
|
91322
| 91323 |
91324
|
91325
|
91326
|
91644