Bugzilla – Attachment 135177 Details for
Bug 30781
Use of uninitialized value $val in substitution iterator at /usr/share/koha/lib/C4/Letters.pm line 665.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30781: Add unit test for substitute with undefined value
Bug-30781-Add-unit-test-for-substitute-with-undefi.patch (text/plain), 2.02 KB, created by
Fridolin Somers
on 2022-05-19 03:53:25 UTC
(
hide
)
Description:
Bug 30781: Add unit test for substitute with undefined value
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2022-05-19 03:53:25 UTC
Size:
2.02 KB
patch
obsolete
>From dc09f05bab97692087c700f4cf58c7cb4eff16e8 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 18 May 2022 17:47:18 -1000 >Subject: [PATCH] Bug 30781: Add unit test for substitute with undefined value > >Add unit test that generates warn. >This may be usefull as no regression test. > >Run prove t/db_dependent/Letters.t >You see warn : >t/db_dependent/Letters.t .. 1/84 Use of uninitialized value $val in substitution iterator at /kohadevbox/koha/C4/Letters.pm line 607. >--- > t/db_dependent/Letters.t | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index 9a37118503..c4d924ff79 100755 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -18,7 +18,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 83; >+use Test::More tests => 84; > use Test::MockModule; > use Test::Warn; > use Test::Exception; >@@ -279,6 +279,17 @@ $prepared_letter = GetPreparedLetter(( > $my_content_letter = qq|This is a SMS for an $substitute->{status}|; > is( $prepared_letter->{content}, $my_content_letter, 'GetPreparedLetter returns the content correctly' ); > >+$prepared_letter = GetPreparedLetter(( >+ module => 'my module', >+ branchcode => $library->{branchcode}, >+ letter_code => 'my code', >+ tables => $tables, >+ substitute => { status => undef }, >+ repeat => $repeat, >+ message_transport_type => 'sms', >+)); >+is( $prepared_letter->{content}, q|This is a SMS for an |, 'GetPreparedLetter returns the content correctly when substitute contains undefined value' ); >+ > $dbh->do(q{INSERT INTO letter (module, code, name, title, content) VALUES ('test_date','TEST_DATE','Test dates','A title with a timestamp: <<biblio.timestamp>>','This one only contains the date: <<biblio.timestamp | dateonly>>.');}); > $prepared_letter = GetPreparedLetter(( > module => 'test_date', >-- >2.35.3
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 30781
:
135177
|
135178
|
135192
|
135193
|
135219
|
135220
|
135222