Bugzilla – Attachment 118197 Details for
Bug 26734
Convert accounts (monetary) notices to use GetPreparedLetter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26734: (QA follow-up) Unit tests for C4::Letters
Bug-26734-QA-follow-up-Unit-tests-for-C4Letters.patch (text/plain), 2.03 KB, created by
Martin Renvoize (ashimema)
on 2021-03-12 13:56:42 UTC
(
hide
)
Description:
Bug 26734: (QA follow-up) Unit tests for C4::Letters
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-12 13:56:42 UTC
Size:
2.03 KB
patch
obsolete
>From 39a369474c55fbeb14c274b82aa012faf940c4d6 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 12 Mar 2021 13:50:14 +0000 >Subject: [PATCH] Bug 26734: (QA follow-up) Unit tests for C4::Letters > >This patch adds unit tests for the addition of 'include handling' to the >C4::Letters template toolkit functionality. > >Test plan >1/ Run t/db_dependant/Letters/TemplateToolkit.t >--- > t/db_dependent/Letters/TemplateToolkit.t | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t >index 2489ebe35c..8d049423c6 100755 >--- a/t/db_dependent/Letters/TemplateToolkit.t >+++ b/t/db_dependent/Letters/TemplateToolkit.t >@@ -19,7 +19,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 27; >+use Test::More tests => 28; > use Test::MockModule; > use Test::Warn; > >@@ -1082,6 +1082,28 @@ subtest 'add_tt_filters' => sub { > is( $letter->{content}, $expected_letter, "Pre-processing should call TT plugin to remove punctuation if table is biblio or biblioitems"); > }; > >+subtest 'Handle includes' => sub { >+ plan tests => 1; >+ my $cgi = CGI->new(); >+ my $code = 'TEST_INCLUDE'; >+ my $account = >+ $builder->build_object( { class => 'Koha::Account::Lines', value => { credit_type_code => 'PAYMENT', status => 'CANCELLED' } } ); >+ my $template = <<EOF; >+[%- USE Price -%] >+[%- PROCESS 'accounts.inc' -%] >+[%- PROCESS account_type_description account=credit -%] >+EOF >+ reset_template({ template => $template, code => $code, module => 'test' }); >+ my $letter = GetPreparedLetter( >+ module => 'test', >+ letter_code => $code, >+ tables => { >+ credits => $account->accountlines_id >+ } >+ ); >+ is($letter->{content},' <span>Payment<span> (Cancelled)</span> </span>', "Include used in notice"); >+}; >+ > subtest 'Dates formatting' => sub { > plan tests => 1; > my $code = 'TEST_DATE'; >-- >2.20.1
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 26734
:
111976
|
111977
|
111978
|
112023
|
112024
|
112025
|
112026
|
116257
|
116259
|
116260
|
116261
|
116262
|
116263
|
116272
|
116275
|
116276
|
116277
|
116278
|
116279
|
116644
|
116645
|
116646
|
116647
|
116648
|
116655
|
116656
|
116657
|
116658
|
116659
|
116663
|
116664
|
116665
|
116666
|
116667
|
117261
|
117262
|
117263
|
117264
|
117265
|
118191
|
118192
|
118193
|
118194
|
118195
|
118196
|
118197
|
118200
|
118482
|
118483
|
118484
|
118485
|
118486
|
118487
|
118488
|
118489
|
119350
|
119351
|
119352
|
119353
|
119354
|
119355
|
119356
|
119357
|
119358
|
119642
|
120077
|
121446
|
121449