Bugzilla – Attachment 110757 Details for
Bug 21979
Add option to SIP2 config to send arbitrary item field in CR instead of collection code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21979: Add unit tests
Bug-21979-Add-unit-tests.patch (text/plain), 2.83 KB, created by
Kyle M Hall (khall)
on 2020-09-25 13:36:09 UTC
(
hide
)
Description:
Bug 21979: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-09-25 13:36:09 UTC
Size:
2.83 KB
patch
obsolete
>From 316694c5f4eb82554cc12dcdbf81b9bf2544f8f2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 25 Sep 2020 09:35:49 -0400 >Subject: [PATCH] Bug 21979: Add unit tests > >--- > t/db_dependent/SIP/Message.t | 59 +++++++++++++++++++++++++++++++++++- > 1 file changed, 58 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index d351f69f51..31baf30e3a 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -21,7 +21,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 8; >+use Test::More tests => 9; > use Test::MockObject; > use Test::MockModule; > use Test::Warn; >@@ -198,6 +198,63 @@ subtest "Test build_additional_item_fields_string" => sub { > $schema->storage->txn_rollback; > }; > >+subtest "Test cr_item_field" => sub { >+ plan tests => 1; >+ >+ my $builder = t::lib::TestBuilder->new(); >+ my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; >+ my $branchcode2 = $builder->build({ source => 'Branch' })->{branchcode}; >+ my ( $response, $findpatron ); >+ my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); >+ >+ # create some data >+ my $patron1 = $builder->build({ >+ source => 'Borrower', >+ value => { >+ password => hash_password( PATRON_PW ), >+ }, >+ }); >+ my $card1 = $patron1->{cardnumber}; >+ my $sip_patron1 = C4::SIP::ILS::Patron->new( $card1 ); >+ $findpatron = $sip_patron1; >+ my $item_object = $builder->build_sample_item({ >+ damaged => 0, >+ withdrawn => 0, >+ itemlost => 0, >+ restricted => 0, >+ homebranch => $branchcode, >+ holdingbranch => $branchcode, >+ }); >+ >+ my $mockILS = $mocks->{ils}; >+ my $server = { ils => $mockILS, account => {} }; >+ $mockILS->mock( 'institution', sub { $branchcode; } ); >+ $mockILS->mock( 'supports', sub { return; } ); >+ $mockILS->mock( 'checkin', sub { >+ shift; >+ return C4::SIP::ILS->checkin(@_); >+ }); >+ my $today = dt_from_string; >+ >+ my $respcode; >+ >+ # Not checked out, toggle option checked_in_ok >+ my $siprequest = CHECKIN . 'N' . 'YYYYMMDDZZZZHHMMSS' . >+ siprequestdate( $today->clone->add( days => 1) ) . >+ FID_INST_ID . $branchcode . '|'. >+ FID_ITEM_ID . $item_object->barcode . '|' . >+ FID_TERMINAL_PWD . 'ignored' . '|'; >+ undef $response; >+ my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >+ >+ $server->{account}->{cr_item_field} = 'itemnumber'; >+ >+ $msg->handle_checkin( $server ); >+ >+ my $id = $item_object->id; >+ ok( $response =~ m/CR$id/, "Found correct CR field in response"); >+}; >+ > subtest 'Patron info summary > 5 should not crash server' => sub { > > my $schema = Koha::Database->new->schema; >-- >2.24.1 (Apple Git-126)
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 21979
:
82998
|
83102
|
93358
|
93535
|
98066
|
101308
|
108502
|
110746
| 110757