Bugzilla – Attachment 189994 Details for
Bug 41324
Tidy kohaTable block
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41324: Add a xt test
a307855.patch (text/plain), 2.18 KB, created by
Jonathan Druart
on 2025-11-27 14:32:12 UTC
(
hide
)
Description:
Bug 41324: Add a xt test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-11-27 14:32:12 UTC
Size:
2.18 KB
patch
obsolete
>From a307855da03eda6f4b3f5f9115ed7c63459df862 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 27 Nov 2025 15:22:00 +0100 >Subject: [PATCH] Bug 41324: Add a xt test > >--- > xt/tt_kohaTable_tidy.t | 56 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 56 insertions(+) > create mode 100755 xt/tt_kohaTable_tidy.t > >diff --git a/xt/tt_kohaTable_tidy.t b/xt/tt_kohaTable_tidy.t >new file mode 100755 >index 00000000000..09951944396 >--- /dev/null >+++ b/xt/tt_kohaTable_tidy.t >@@ -0,0 +1,56 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# 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 <https://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use File::Slurp qw( read_file ); >+use Test::More; >+ >+use Test::NoWarnings; >+ >+use Koha::Devel::Files; >+ >+my $dev_files = Koha::Devel::Files->new( { context => 'tidy' } ); >+my @tt_files = $dev_files->ls_tt_files; >+ >+plan tests => scalar(@tt_files) + 1; >+ >+for my $file (@tt_files) { >+ >+ my @lines = read_file($file); >+ my $fails = 0; >+ my ( $in_script, $has_tt_tags, $has_kohaTable ); >+ for my $line (@lines) { >+ >+ $in_script ||= $line =~ m{<script}; >+ >+ if ( $line =~ m{<\/script>} ) { >+ if ( $has_kohaTable && $has_tt_tags ) { >+ $fails++; >+ } >+ $has_kohaTable = 0; >+ $has_tt_tags = 0; >+ $in_script = 0; >+ } >+ next unless $in_script; >+ >+ $has_kohaTable ||= $line =~ m{\).kohaTable\(}; >+ >+ $has_tt_tags ||= $line =~ m{\[\%.*?\%\]}s; >+ } >+ >+ is( $fails, 0, "$file has 'kohaTable' instances in a <script> tag with Template::Toolkit tags." ); >+} >-- >2.43.0 >
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 41324
: 189994 |
189995
|
189996