Bug 929 : Follow up to allow tests to check plugins too

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
perl xt/author/valid-templates.t runs without errors now.
(cherry picked from commit 2cfb891c83)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
(cherry picked from commit 5b08ae3861)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
Chris Cormack 2012-01-14 07:28:11 +13:00 committed by Chris Nighswonger
parent a8f6e45d4c
commit 9f7274080d
1 changed files with 12 additions and 7 deletions

View File

@ -50,13 +50,18 @@ done_testing();
sub create_template_test {
my $includes = shift;
return sub {
my $tt = Template->new({ABSOLUTE => 1,
INCLUDE_PATH => $includes });
my $vars;
my $output;
if ( ! ok($tt->process($_,$vars,\$output), $_) ){
diag($tt->error);
}
my $tt = Template->new(
{
ABSOLUTE => 1,
INCLUDE_PATH => $includes,
PLUGIN_BASE => 'Koha::Template::Plugin',
}
);
my $vars;
my $output;
if ( !ok( $tt->process( $_, $vars, \$output ), $_ ) ) {
diag( $tt->error );
}
}
}