Lines 37-42
This test checks all staff and OPAC templates and includes for syntax errors
Link Here
|
37 |
use File::Find; |
37 |
use File::Find; |
38 |
use File::Spec; |
38 |
use File::Spec; |
39 |
use Template; |
39 |
use Template; |
|
|
40 |
use Template::Plugins; |
41 |
use Koha::Template::Plugin::raw; |
40 |
use Test::More; |
42 |
use Test::More; |
41 |
|
43 |
|
42 |
my @themes; |
44 |
my @themes; |
Lines 121-133
sub create_template_test {
Link Here
|
121 |
my $interface = $includes =~ s|^.*/([^/]*-tmpl).*$|$1|r; |
123 |
my $interface = $includes =~ s|^.*/([^/]*-tmpl).*$|$1|r; |
122 |
my $theme = ($interface =~ /opac/) ? 'bootstrap' : 'prog'; |
124 |
my $theme = ($interface =~ /opac/) ? 'bootstrap' : 'prog'; |
123 |
|
125 |
|
|
|
126 |
my $plugins = Template::Plugins->new( { PLUGIN_BASE => 'Koha::Template::Plugin' } ); |
127 |
|
124 |
return sub { |
128 |
return sub { |
125 |
my $tt = Template->new( |
129 |
my $tt = Template->new( |
126 |
{ |
130 |
{ |
127 |
ABSOLUTE => 1, |
131 |
ABSOLUTE => 1, |
128 |
INCLUDE_PATH => $includes, |
132 |
INCLUDE_PATH => $includes, |
129 |
PLUGIN_BASE => 'Koha::Template::Plugin', |
133 |
PLUGIN_BASE => 'Koha::Template::Plugin', |
130 |
LOAD_PLUGINS => [ 'Koha', 'Asset', 'raw' ], |
134 |
LOAD_PLUGINS => [ $plugins ], |
|
|
135 |
LOAD_FILTERS => [ |
136 |
'Koha::Template::Plugin::raw', |
137 |
], |
138 |
FILTERS => {} |
131 |
} |
139 |
} |
132 |
); |
140 |
); |
133 |
foreach my $exclusion (@exclusions) { |
141 |
foreach my $exclusion (@exclusions) { |
134 |
- |
|
|