Bug 42136: Add tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
268863392e
commit
9cac08f749
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
use Modern::Perl;
|
use Modern::Perl;
|
||||||
use Test::NoWarnings;
|
use Test::NoWarnings;
|
||||||
use Test::More tests => 4;
|
use Test::More tests => 5;
|
||||||
|
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
|
|
@ -59,3 +59,24 @@ subtest 'Plugin related tests' => sub {
|
||||||
"Processing template toolkit with a Koha plugin works"
|
"Processing template toolkit with a Koha plugin works"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
subtest 'Security-related tests' => sub {
|
||||||
|
plan tests => 2;
|
||||||
|
|
||||||
|
is(
|
||||||
|
Koha::TemplateUtils::process_tt(
|
||||||
|
q{[% USE dir = Directory('/') ~%]
|
||||||
|
[% FOREACH entry IN dir.list ~%]
|
||||||
|
<p>[% entry.abs %]</p>
|
||||||
|
[% END %]},
|
||||||
|
),
|
||||||
|
q{},
|
||||||
|
"Plugins not allowed for User-entered TT"
|
||||||
|
);
|
||||||
|
|
||||||
|
is(
|
||||||
|
Koha::TemplateUtils::process_tt(q{[% USE raw %][% 'foo' | $raw %]}),
|
||||||
|
q{foo},
|
||||||
|
"Koha plugins are still available"
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue