From a115a474c1613a4bcd15cbd7f607d4cf5a92132d Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Wed, 6 Oct 2010 13:17:32 -0400 Subject: [PATCH] Bug 5284 - Generic report covering various problems with the labels/patron card tests This patch fixes the C4::Labels::Layout tests --- C4/Creators/Layout.pm | 5 +++++ t/db_dependent/Labels/t_Layout.t | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/C4/Creators/Layout.pm b/C4/Creators/Layout.pm index 1a912fe710..3281e15567 100644 --- a/C4/Creators/Layout.pm +++ b/C4/Creators/Layout.pm @@ -40,6 +40,8 @@ sub _check_params { 'format_string', 'layout_xml', # FIXME: all layouts should be stored in xml format to greatly simplify handling -chris_n 'creator', + 'units', + 'start_label', ); if (scalar(@_) >1) { my %given_params = @_; @@ -68,6 +70,9 @@ sub new { my $type = ref($invocant) || $invocant; if (grep {$_ eq 'Labels'} @_) { $self = { + layout_xml => '', + units => 'POINT', + start_label => 1, barcode_type => 'CODE39', printing_type => 'BAR', layout_name => 'DEFAULT', diff --git a/t/db_dependent/Labels/t_Layout.t b/t/db_dependent/Labels/t_Layout.t index 1ba618e491..462f0568d8 100644 --- a/t/db_dependent/Labels/t_Layout.t +++ b/t/db_dependent/Labels/t_Layout.t @@ -20,7 +20,7 @@ use strict; use warnings; -use Test::More tests => 28; +use Test::More tests => 36; use C4::Context; use Data::Dumper; @@ -29,6 +29,10 @@ BEGIN { } my $default_layout = { + creator => 'Labels', + layout_xml => '', + units => 'POINT', + start_label => 1, barcode_type => 'CODE39', printing_type => 'BAR', layout_name => 'TEST', @@ -53,6 +57,10 @@ foreach my $key (keys %{$default_layout}) { diag "Testing Layout->set_attr() method."; my $new_attr = { + creator => 'Labels', + layout_xml => '', + units => 'POINT', + start_label => 1, barcode_type => 'CODE39', printing_type => 'BIBBAR', layout_name => 'TEST', @@ -97,4 +105,4 @@ ok($updated_layout->get_text_wrap_cols(label_width => 180, left_text_margin => 1 diag "Testing Layout->delete() method."; my $del_results = $updated_layout->delete(); -ok($del_results eq 0) || diag "Layout->delete() FAILED"; +ok($del_results ne -1) || diag "Layout->delete() FAILED"; -- 2.20.1