Bugzilla – Attachment 148076 Details for
Bug 33030
Add standardized subroutine for processing Template Toolkit syntax outside of notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33030: Add unit tests
Bug-33030-Add-unit-tests.patch (text/plain), 2.16 KB, created by
Kyle M Hall (khall)
on 2023-03-10 15:20:26 UTC
(
hide
)
Description:
Bug 33030: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-03-10 15:20:26 UTC
Size:
2.16 KB
patch
obsolete
>From cb2b0df59930a8bab388a817946186fd2ebce6ad Mon Sep 17 00:00:00 2001 >From: Kyle Hall <kyle@bywatersolutions.com> >Date: Fri, 10 Mar 2023 10:20:07 -0500 >Subject: [PATCH] Bug 33030: Add unit tests > >--- > t/Template/Utils.t | 60 ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 60 insertions(+) > create mode 100755 t/Template/Utils.t > >diff --git a/t/Template/Utils.t b/t/Template/Utils.t >new file mode 100755 >index 0000000000..1a66addea7 >--- /dev/null >+++ b/t/Template/Utils.t >@@ -0,0 +1,60 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright (C) 2023 ByWater Solutions >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use Test::More tests => 3; >+ >+use utf8; >+ >+use_ok('Koha::TemplateUtils'); >+ >+subtest 'Process arbitrary var' => sub { >+ plan tests => 2; >+ >+ is( >+ Koha::TemplateUtils::process_tt( >+ "This is a test.", >+ { test => 'simple test' } >+ ), >+ "This is a test.", >+ "Processing template toolkit with no TT markup works" >+ ); >+ >+ is( >+ Koha::TemplateUtils::process_tt( >+ "This is a [% test %].", >+ { test => 'simple test' } >+ ), >+ "This is a simple test.", >+ "Processing template toolkit with a var works" >+ ); >+}; >+ >+subtest 'Plugin related tests' => sub { >+ plan tests => 1; >+ >+ is( >+ Koha::TemplateUtils::process_tt( >+ q{[% USE raw %]This is a [% test | $raw %].}, >+ { test => 'simple test' } >+ ), >+ "This is a simple test.", >+ "Processing template tookit with a Koha plugin works" >+ ); >+}; >-- >2.30.2
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 33030
:
147085
|
147182
|
148076
|
150511
|
150512
|
153142
|
153143