X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2FLabels.t;h=1eac116bb9ce4d56582f7f7d677da35240778d9d;hb=66aacace086f16d2eca860cc6c2aa164866d0488;hp=823511b5bed317fa1253eaa444e9be9322664770;hpb=367c4fb8815bfe4a01869a25bcd8222989c15dcd;p=koha.git diff --git a/t/Labels.t b/t/Labels.t index 823511b5be..1eac116bb9 100644 --- a/t/Labels.t +++ b/t/Labels.t @@ -2,25 +2,25 @@ # # 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 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 3 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. +# 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 +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . # # for context, see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2691 use strict; use warnings; -use Test::More tests => 6; +use Test::More tests => 11; BEGIN { use_ok('C4::Labels::Label'); @@ -36,7 +36,29 @@ is_deeply($parsed_fields, $expected_fields, '"callnumber" in label layout alias is(C4::Labels::Label::_check_params(),"0",'test checking parameters'); -ok(C4::Labels::Label::_guide_box(), 'test guide box with nothing entered'); +my ($llx,$lly,$width,$height) = ( 0, 0, 10, 10 ); +ok(!defined C4::Labels::Label::_guide_box(), + "Test guide box with undefined parameters returns undef"); +ok(!defined C4::Labels::Label::_guide_box(undef,$lly,$width,$height), + "Test guide box with undefined 'x' coordinate returns undef"); +ok(!defined C4::Labels::Label::_guide_box($llx,undef,$width,$height), + "Test guide box with undefined 'y' coordinate returns undef"); +ok(!defined C4::Labels::Label::_guide_box($llx,$lly,undef,$height), + "Test guide box with undefined 'width' returns undef"); +ok(!defined C4::Labels::Label::_guide_box($llx,$lly,$width,undef), + "Test guide box with undefined 'height' returns undef"); +is( + C4::Labels::Label::_guide_box($llx, $lly, $width, $height), + 'q +0.5 w +1.0 0.0 0.0 RG +1.0 1.0 1.0 rg +0 0 10 10 re +B +Q +', + 'Return guide box if all four parameters are defined' +); ok(C4::Labels::Label::_get_text_fields(), 'test getting textx fields');