View | Details | Raw Unified | Return to bug 8470
Collapse All | Expand All

(-)a/xt/author/test_template.pl (-59 lines)
Lines 1-58 Link Here
1
#!/usr/bin/perl
2
3
# Copyright (C) 2009 LibLime
4
# 
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use strict;
21
use warnings;
22
23
=head1 NAME
24
25
test_template.pl
26
27
=head2 DESCRIPTION
28
29
This helper script is invoked by xt/author/valid-templates.t
30
and tests a template for basic syntax errors by having
31
HTML::Template::Pro parse it.
32
33
=cut
34
35
use FindBin qw($Bin);
36
use HTML::Template::Pro;
37
38
my $filename    = $ARGV[0];
39
my $include_dir = $ARGV[1];
40
41
my $template = HTML::Template::Pro->new(
42
    filename          => $filename,
43
    die_on_bad_params => 1,
44
    global_vars       => 1,
45
    case_sensitive    => 1,
46
    loop_context_vars => 1,     # enable: __first__, __last__, __inner__, __odd__, __counter__ 
47
    path              => [$include_dir],
48
);
49
50
$template->output; # tossing output
51
52
=head1 AUTHOR
53
54
Koha Development Team <http://koha-community.org/>
55
56
Galen Charlton <galen.charlton@liblime.com>
57
58
=cut
59
- 

Return to bug 8470