Bugzilla – Attachment 174284 Details for
Bug 38284
handle_patron_status dies if patron not found
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38284: Add tests
Bug-38284-Add-tests.patch (text/plain), 2.24 KB, created by
Martin Renvoize (ashimema)
on 2024-11-08 16:28:30 UTC
(
hide
)
Description:
Bug 38284: Add tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-11-08 16:28:30 UTC
Size:
2.24 KB
patch
obsolete
>From 79bc40a2d30bd3d35e3a99286b16edd481197eb4 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 29 Oct 2024 09:23:31 +0000 >Subject: [PATCH] Bug 38284: Add tests > >Sponsored-by: PTFS Europe <https://ptfs-europe.com> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/SIP/Message.t | 39 +++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Message.t b/t/db_dependent/SIP/Message.t >index 325d9361d44..2e3207076e1 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 => 21; >+use Test::More tests => 22; > use Test::Exception; > use Test::MockObject; > use Test::MockModule; >@@ -492,6 +492,43 @@ subtest 'Lastseen response patron status' => sub { > > }; > >+subtest 'Invalid cardnumber test response patron status' => sub { >+ >+ plan tests => 1; >+ >+ my $schema = Koha::Database->new->schema; >+ $schema->storage->txn_begin; >+ >+ my $builder = t::lib::TestBuilder->new(); >+ my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode}; >+ my ( $response, $findpatron ); >+ my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); >+ my $cardnum = 'nonexistentcardnumber'; >+ my $sip_patron = C4::SIP::ILS::Patron->new($cardnum); >+ $findpatron = $sip_patron; >+ >+ my $siprequest = >+ PATRON_STATUS_REQ >+ . '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} }; >+ undef $response; >+ >+ t::lib::Mocks::mock_preference( 'TrackLastPatronActivityTriggers', 'login' ); >+ $msg->handle_patron_status($server); >+ isnt( $response, undef, 'At least we got a response.' ); >+ >+ $schema->storage->txn_rollback; >+ >+}; >+ > subtest "Test build_additional_item_fields_string" => sub { > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >-- >2.47.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 38284
:
173603
|
173604
|
173735
|
173736
|
173922
|
173923
| 174284 |
174285