Bugzilla – Attachment 173712 Details for
Bug 37582
SIP2 responses can contain newlines when a patron has multiple debarments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37582: Add unit test [WIP]
Bug-37582-Add-unit-test-WIP.patch (text/plain), 2.10 KB, created by
Kyle M Hall (khall)
on 2024-10-30 11:55:10 UTC
(
hide
)
Description:
Bug 37582: Add unit test [WIP]
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-10-30 11:55:10 UTC
Size:
2.10 KB
patch
obsolete
>From 591fd7ee7c0cca718b18dd6893601ba870c7cea3 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 30 Oct 2024 11:53:35 +0000 >Subject: [PATCH] Bug 37582: Add unit test [WIP] > >--- > t/db_dependent/SIP/Message.t | 39 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index 7975619b075..befb8112e36 100755 >--- a/t/db_dependent/SIP/Message.t >+++ b/t/db_dependent/SIP/Message.t >@@ -1637,6 +1637,45 @@ sub test_renew_desensitize { > > } > >+subtest 'Test convert_nonprinting_characters' => sub { >+ >+ my $schema = Koha::Database->new->schema; >+ $schema->storage->txn_begin; >+ >+ plan tests => 1; >+ my $builder = t::lib::TestBuilder->new(); >+ my $branchcode = $builder->build({ source => 'Branch' })->{branchcode}; >+ my ( $response, $findpatron ); >+ my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); >+ my $seen_patron = $builder->build({ >+ source => 'Borrower', >+ value => { >+ lastseen => '2001-01-01', >+ password => hash_password( PATRON_PW ), >+ branchcode => $branchcode, >+ dateexpiry => '3000-01-01', >+ debarred => '3000-01-01', >+ debarredcomment => "Comment 1\nComment 2\nComment 3", >+ }, >+ }); >+ my $cardnum = $seen_patron->{cardnumber}; >+ my $sip_patron = C4::SIP::ILS::Patron->new( $cardnum ); >+ $findpatron = $sip_patron; >+ >+ my $siprequest = PATRON_INFO . 'engYYYYMMDDZZZZHHMMSS' . ' ' . >+ FID_INST_ID . $branchcode . '|' . >+ FID_PATRON_ID . $cardnum . '|' . >+ FID_PATRON_PWD . PATRON_PW . '|'; >+ my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); >+ >+ my $server = { ils => $mocks->{ils}, account => { convert_nonprinting_characters => ' -- '} }; >+ $msg->handle_patron_info( $server ); >+ >+ like( $response, qr/Comment 1 -- Comment 2 -- Comment 3/, "Response contains converted restriction comment" ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > # Helper routines > > sub create_mocks { >-- >2.39.5 (Apple Git-154)
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 37582
:
171642
|
171643
|
171644
|
173081
|
173082
|
173306
|
173502
|
173503
|
173712
|
173715