Bugzilla – Attachment 173922 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.13 KB, created by
Pedro Amorim
on 2024-11-04 14:13:56 UTC
(
hide
)
Description:
Bug 38284: Add tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-11-04 14:13:56 UTC
Size:
2.13 KB
patch
obsolete
>From a1bfc1f73e0903bbfd121fbcb7f0d47165883fa6 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 > >Signed-off-by: David Nind <david@davidnind.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 325d9361d4..2e3207076e 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.39.5
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