|
Lines 19-25
Link Here
|
| 19 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
| 20 |
|
20 |
|
| 21 |
use Modern::Perl; |
21 |
use Modern::Perl; |
| 22 |
use Test::More tests => 17; |
22 |
use Test::More tests => 18; |
| 23 |
use Test::Warn; |
23 |
use Test::Warn; |
| 24 |
|
24 |
|
| 25 |
use MARC::Record; |
25 |
use MARC::Record; |
|
Lines 894-899
subtest 'loops' => sub {
Link Here
|
| 894 |
}; |
894 |
}; |
| 895 |
}; |
895 |
}; |
| 896 |
|
896 |
|
|
|
897 |
subtest 'add_tt_filters' => sub { |
| 898 |
plan tests => 1; |
| 899 |
my $code = "TEST"; |
| 900 |
my $module = "TEST"; |
| 901 |
|
| 902 |
my $patron = $builder->build_object( |
| 903 |
{ |
| 904 |
class => 'Koha::Patrons', |
| 905 |
value => { surname => "with_punctuation_" } |
| 906 |
} |
| 907 |
); |
| 908 |
my $biblio = $builder->build_object( |
| 909 |
{ class => 'Koha::Biblios', value => { title => "with_punctuation_" } } |
| 910 |
); |
| 911 |
my $biblioitem = $builder->build_object( |
| 912 |
{ |
| 913 |
class => 'Koha::Biblioitems', |
| 914 |
value => { |
| 915 |
biblionumber => $biblio->biblionumber, |
| 916 |
isbn => "with_punctuation_" |
| 917 |
} |
| 918 |
} |
| 919 |
); |
| 920 |
|
| 921 |
my $template = q|patron=[% borrower.surname %];biblio=[% biblio.title %];biblioitems=[% biblioitem.isbn %]|; |
| 922 |
reset_template( { template => $template, code => $code, module => $module } ); |
| 923 |
my $letter = GetPreparedLetter( |
| 924 |
module => $module, |
| 925 |
letter_code => $code, |
| 926 |
tables => { |
| 927 |
borrowers => $patron->borrowernumber, |
| 928 |
biblio => $biblio->biblionumber, |
| 929 |
biblioitems => $biblioitem->biblioitemnumber |
| 930 |
} |
| 931 |
); |
| 932 |
my $expected_letter = q|patron=with_punctuation_;biblio=with_punctuation;biblioitems=with_punctuation|; |
| 933 |
is( $letter->{content}, $expected_letter, "Pre-processing should call TT plugin to remove punctuation if table is biblio or biblioitems"); |
| 934 |
}; |
| 935 |
|
| 936 |
|
| 897 |
sub reset_template { |
937 |
sub reset_template { |
| 898 |
my ( $params ) = @_; |
938 |
my ( $params ) = @_; |
| 899 |
my $template = $params->{template}; |
939 |
my $template = $params->{template}; |
| 900 |
- |
|
|