Bugzilla – Attachment 144564 Details for
Bug 32442
Invalid Template Toolkit in notices can cause errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32442: Add tests
Bug-32442-Add-tests.patch (text/plain), 1.71 KB, created by
Jonathan Druart
on 2022-12-14 07:47:36 UTC
(
hide
)
Description:
Bug 32442: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-12-14 07:47:36 UTC
Size:
1.71 KB
patch
obsolete
>From a1794d39f02dd979465dce32fdc42be562e8d2ed Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 14 Dec 2022 08:31:01 +0100 >Subject: [PATCH] Bug 32442: Add tests > >--- > t/db_dependent/Letters/TemplateToolkit.t | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Letters/TemplateToolkit.t b/t/db_dependent/Letters/TemplateToolkit.t >index 3cd45e6fd29..edd91ac091e 100755 >--- a/t/db_dependent/Letters/TemplateToolkit.t >+++ b/t/db_dependent/Letters/TemplateToolkit.t >@@ -3,7 +3,7 @@ > # This file is part of Koha. > # > # Copyright (C) 2016 ByWater Solutions >-# Copyright (C) 2017 Koha Development Team >+# Copyright (C) 2022 Koha Development Team > # > # Koha is free software; you can redistribute it and/or modify it > # under the terms of the GNU General Public License as published by >@@ -19,7 +19,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 30; >+use Test::More tests => 31; > use Test::MockModule; > use Test::Warn; > >@@ -1207,6 +1207,21 @@ EOF > my $branchcode = $library->branchcode; > like($letter->{content}, qr{=$branchcode=}, 'content generated with the library'); > is( ref($library->get_from_storage), 'Koha::Library', 'calling ->delete on the object has not been comitted'); >+ >+}; >+ >+subtest '_process_letter croaks on parsing error' => sub { >+ >+ plan tests => 1; >+ >+ my $params = { >+ code => 'TEST_CROAK', >+ substitute => { count => 42 }, >+ }; >+ >+ my $tt_template = q|[% IF %]|; >+ eval { process_letter( { template => $tt_template, %$params } ) }; >+ like($@, qr{^ERROR PROCESSING TEMPLATE: }); > }; > > sub reset_template { >-- >2.25.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 32442
:
144564
|
144565
|
144686
|
144687
|
145862
|
145863