X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=t%2FLabels.t;h=2450794cce1e4d28a5e9780f82295b651806f843;hb=306dc79217783ebd7896be64deee12491febc4d3;hp=fb9d1dc5d566d9c50857607045692d4b88706ed8;hpb=77618f43cf589c5dddcf5ad13f8afda51d1a1129;p=koha_fer diff --git a/t/Labels.t b/t/Labels.t index fb9d1dc5d5..2450794cce 100644 --- a/t/Labels.t +++ b/t/Labels.t @@ -1,5 +1,35 @@ -BEGIN { $| = 1; print "1..1\n"; } -END {print "not ok 1\n" unless $loaded;} -use C4::Labels; -$loaded = 1; -print "ok 1\n"; +#!/usr/bin/perl +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# +# for context, see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2691 + +use strict; +use warnings; + +use Test::More tests => 2; + +BEGIN { + use_ok('C4::Labels::Label'); +} + +my $format_string = "title, callnumber"; +my $parsed_fields = C4::Labels::Label::_get_text_fields($format_string); +my $expected_fields = [ + { code => 'title', desc => 'title' }, + { code => 'itemcallnumber', desc => 'itemcallnumber' }, +]; +is_deeply($parsed_fields, $expected_fields, '"callnumber" in label layout alias for "itemcallnumber" per bug 5653');