File Coverage

File:t/Labels.t
Coverage:100.0%

linestmtbrancondsubtimecode
1#!/usr/bin/perl
2#
3# This file is part of Koha.
4#
5# Koha is free software; you can redistribute it and/or modify it under the
6# terms of the GNU General Public License as published by the Free Software
7# Foundation; either version 2 of the License, or (at your option) any later
8# version.
9#
10# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along with
15# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16# Suite 330, Boston, MA 02111-1307 USA
17#
18# for context, see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2691
19
20
1
1
1
1.33283530073248e+15
2
29
use strict;
21
1
1
1
4
1
50
use warnings;
22
23
1
1
1
422
19498
14
use Test::More tests => 6;
24
25BEGIN {
26
1
1537
    use_ok('C4::Labels::Label');
27}
28
29
1
535466
my $format_string = "title, callnumber";
30
1
56
my $parsed_fields = C4::Labels::Label::_get_text_fields($format_string);
31
1
10
my $expected_fields = [
32    { code => 'title', desc => 'title' },
33    { code => 'itemcallnumber', desc => 'itemcallnumber' },
34];
35
1
12
is_deeply($parsed_fields, $expected_fields, '"callnumber" in label layout alias for "itemcallnumber" per bug 5653');
36
37
1
1592
is(C4::Labels::Label::_check_params(),"0",'test checking parameters');
38
39
1
1511
ok(C4::Labels::Label::_guide_box(), 'test guide box with nothing entered');
40
41
1
825
ok(C4::Labels::Label::_get_text_fields(), 'test getting textx fields');
42
43
1
503
is(C4::Labels::Label::_split_lccn(),"0", 'test when _split_lccn is null');