diff --git a/t/db_dependent/Templates.t b/t/db_dependent/Templates.t index 236bd1e637..852884b942 100755 --- a/t/db_dependent/Templates.t +++ b/t/db_dependent/Templates.t @@ -19,8 +19,12 @@ use Modern::Perl; use CGI; -use Test::More tests => 5; +use Test::More tests => 6; use Test::Deep; +use Test::MockModule; +use Test::Warn; + +use t::lib::Mocks; BEGIN { use_ok( 'C4::Templates' ); @@ -46,4 +50,12 @@ my @tables = ( 'biblio', 'biblioitems', 'borrowers', 'items', 'statistics', 'sub cmp_deeply( \@keys, \@tables, "GetColumnDefs returns the expected tables"); +subtest 'Testing gettemplate' => sub { + plan tests => 2; + + my $template; + warning_like { eval { $template = C4::Templates::gettemplate( '/etc/passwd', 'opac', CGI->new, 1 ) }; warn $@ if $@; } qr/bad template/, 'Bad template check'; + is( $template ? $template->output: '', '', 'Check output' ); +}; + 1;