X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=t%2FLabels.t;h=f762a733fb03d1c32453be363c168c26cb64ce91;hb=5d6c092921919526ade501facb1220f8a108a08f;hp=2450794cce1e4d28a5e9780f82295b651806f843;hpb=bd73c9f9ce8d161a1ed0f2e1205e5c0c8eecb0ae;p=koha_fer diff --git a/t/Labels.t b/t/Labels.t index 2450794cce..f762a733fb 100644 --- a/t/Labels.t +++ b/t/Labels.t @@ -20,7 +20,7 @@ use strict; use warnings; -use Test::More tests => 2; +use Test::More tests => 11; BEGIN { use_ok('C4::Labels::Label'); @@ -33,3 +33,33 @@ my $expected_fields = [ { code => 'itemcallnumber', desc => 'itemcallnumber' }, ]; is_deeply($parsed_fields, $expected_fields, '"callnumber" in label layout alias for "itemcallnumber" per bug 5653'); + +is(C4::Labels::Label::_check_params(),"0",'test checking parameters'); + +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'); + +is(C4::Labels::Label::_split_lccn(),"0", 'test when _split_lccn is null');