View | Details | Raw Unified | Return to bug 32442
Collapse All | Expand All

(-)a/t/db_dependent/Letters/TemplateToolkit.t (-3 / +17 lines)
Lines 3-9 Link Here
3
# This file is part of Koha.
3
# This file is part of Koha.
4
#
4
#
5
# Copyright (C) 2016 ByWater Solutions
5
# Copyright (C) 2016 ByWater Solutions
6
# Copyright (C) 2017 Koha Development Team
6
# Copyright (C) 2022 Koha Development Team
7
#
7
#
8
# Koha is free software; you can redistribute it and/or modify it
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
9
# under the terms of the GNU General Public License as published by
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 => 30;
22
use Test::More tests => 31;
23
use Test::MockModule;
23
use Test::MockModule;
24
use Test::Warn;
24
use Test::Warn;
25
25
Lines 1207-1212 EOF Link Here
1207
    my $branchcode = $library->branchcode;
1207
    my $branchcode = $library->branchcode;
1208
    like($letter->{content}, qr{=$branchcode=}, 'content generated with the library');
1208
    like($letter->{content}, qr{=$branchcode=}, 'content generated with the library');
1209
    is( ref($library->get_from_storage), 'Koha::Library', 'calling ->delete on the object has not been comitted');
1209
    is( ref($library->get_from_storage), 'Koha::Library', 'calling ->delete on the object has not been comitted');
1210
1211
};
1212
1213
subtest '_process_letter croaks on parsing error' => sub {
1214
1215
    plan tests => 1;
1216
1217
    my $params = {
1218
        code => 'TEST_CROAK',
1219
        substitute => { count => 42 },
1220
    };
1221
1222
    my $tt_template = q|[% IF %]|;
1223
    eval { process_letter( { template => $tt_template, %$params } ) };
1224
    like($@, qr{^ERROR PROCESSING TEMPLATE: });
1210
};
1225
};
1211
1226
1212
sub reset_template {
1227
sub reset_template {
1213
- 

Return to bug 32442