@@ -, +, @@ --- t/HtmlTags.t | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 t/HtmlTags.t --- a/t/HtmlTags.t +++ a/t/HtmlTags.t @@ -0,0 +1,25 @@ +#!/usr/bin/perl +# +# This module tests the HtmlTag filter +# + +use strict; +use warnings; + +use Test::More tests => 4; + +BEGIN { use_ok('Koha::Template::Plugin::HtmlTags'); } + +my $filter = Koha::Template::Plugin::HtmlTags->new(); +ok ($filter, "new()"); + + +# Test simple tag +my $expected = '

TEST

'; +my $created = $filter->filter('TEST','', {tag => 'h1'} ); +is( $created, $expected, "Testing simple tag works: $expected - $created"); + +# Test tag with attributes +$expected = '

TEST

'; +$created = $filter->filter('TEST','', {tag => 'h1', attributes => 'class="MYCLASS" title="MYTITLE"'} ); +is($created, $expected, "Testing tag with attributes works: $expected - $created"); --