Bug 12495 - Include streetnumber in hold alert address
[koha_fer] / t / Labels.t
index 823511b..f762a73 100644 (file)
@@ -20,7 +20,7 @@
 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');