Bug 20538: Prevent warnings in xt/author/valid-templates.t
authorJulian Maurice <julian.maurice@biblibre.com>
Wed, 25 Apr 2018 07:21:30 +0000 (09:21 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 25 Apr 2018 13:08:00 +0000 (10:08 -0300)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

xt/author/valid-templates.t

index b7baf55..9d19537 100644 (file)
@@ -117,6 +117,10 @@ sub run_template_test {
 sub create_template_test {
     my $includes = shift;
     my @exclusions = @_;
+
+    my $interface = $includes =~ s|^.*/([^/]*-tmpl).*$|$1|r;
+    my $theme = ($interface =~ /opac/) ? 'bootstrap' : 'prog';
+
     return sub {
         my $tt = Template->new(
             {
@@ -131,7 +135,7 @@ sub create_template_test {
                 return;
             }
         }
-        my $vars;
+        my $vars = { interface => $interface, theme => $theme };
         my $output;
         if ( ! -d $_ ) {    # skip dirs
             if ( !ok( $tt->process( $_, $vars, \$output ), $_ ) ) {