Bugzilla – Attachment 179583 Details for
Bug 39407
Having no active currency defined breaks SIP silently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39407: Add unit test to prove no active currency crashes SIP
Bug-39407-Add-unit-test-to-prove-no-active-currenc.patch (text/plain), 1.64 KB, created by
Kyle M Hall (khall)
on 2025-03-21 11:05:21 UTC
(
hide
)
Description:
Bug 39407: Add unit test to prove no active currency crashes SIP
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-03-21 11:05:21 UTC
Size:
1.64 KB
patch
obsolete
>From a6eaf8a144f4b414a770535806e16e6c0577f8d3 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 21 Mar 2025 07:00:22 -0400 >Subject: [PATCH] Bug 39407: Add unit test to prove no active currency crashes > SIP > >--- > t/db_dependent/SIP/Patron.t | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/SIP/Patron.t b/t/db_dependent/SIP/Patron.t >index fc6e03bd284..5ed96417a94 100755 >--- a/t/db_dependent/SIP/Patron.t >+++ b/t/db_dependent/SIP/Patron.t >@@ -12,6 +12,7 @@ use t::lib::TestBuilder; > > use C4::SIP::ILS::Patron; > use Koha::Account::Lines; >+use Koha::Acquisition::Currencies; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Patron::Attributes; >@@ -35,7 +36,7 @@ is( $sip_patron2, undef, "Patron is not valid (anymore)" ); > > subtest "new tests" => sub { > >- plan tests => 5; >+ plan tests => 6; > > my $patron = $builder->build( { source => 'Borrower' } ); > >@@ -53,6 +54,11 @@ subtest "new tests" => sub { > is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via cardnumber hashref' ); > $ils_patron = C4::SIP::ILS::Patron->new( { userid => $userid } ); > is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via userid hashref' ); >+ >+ # Verify that having no active currency does not crash C4::SIP::ILS::Patron::new >+ Koha::Acquisition::Currencies->get_active->active(0)->store(); >+ $ils_patron = C4::SIP::ILS::Patron->new( { userid => $userid } ); >+ is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron when no active currency is defined' ); > }; > > subtest "OverduesBlockCirc tests" => sub { >-- >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 39407
:
179583
|
179584
|
179585
|
180060
|
180061
|
180062