Bugzilla – Attachment 158014 Details for
Bug 10762
Make it possible to adjust the barcode height and width on labels
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10762: Fix tests continued
Bug-10762-Fix-tests-continued.patch (text/plain), 3.11 KB, created by
Tomás Cohen Arazi
on 2023-10-28 13:03:09 UTC
(
hide
)
Description:
Bug 10762: Fix tests continued
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2023-10-28 13:03:09 UTC
Size:
3.11 KB
patch
obsolete
>From 7c6ef360cdf77c2aa8d473c756f2b94f39038f21 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Sat, 28 Oct 2023 10:02:26 -0300 >Subject: [PATCH] Bug 10762: Fix tests continued > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Labels/t_Layout.t | 55 ++++++++++++++++++-------------- > 1 file changed, 31 insertions(+), 24 deletions(-) > >diff --git a/t/db_dependent/Labels/t_Layout.t b/t/db_dependent/Labels/t_Layout.t >index 9e269061a44..bf6209d099b 100755 >--- a/t/db_dependent/Labels/t_Layout.t >+++ b/t/db_dependent/Labels/t_Layout.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 40; >+use Test::More tests => 58; > use C4::Context; > > BEGIN { >@@ -59,21 +59,23 @@ foreach my $key (keys %{$default_layout}) { > > # Testing Layout->set_attr() > my $new_attr = { >- creator => 'Labels', >- layout_xml => '', >- units => 'POINT', >- start_label => 1, >- barcode_type => 'CODE39', >- printing_type => 'BIBBAR', >- layout_name => 'TEST', >- guidebox => 1, >- oblique_title => 0, >- font => 'TR', >- font_size => 10, >- callnum_split => 1, >- text_justify => 'L', >- format_string => 'callnumber, title, author, barcode', >- }; >+ barcode_type => 'CODE39', >+ callnum_split => 1, >+ creator => 'Labels', >+ font => 'TR', >+ font_size => 10, >+ format_string => 'callnumber, title, author, barcode', >+ guidebox => 1, >+ layout_name => 'TEST', >+ layout_xml => '', >+ oblique_title => 0, >+ printing_type => 'BIBBAR', >+ scale_height => 0.02, >+ scale_width => 0.9, >+ start_label => 1, >+ text_justify => 'L', >+ units => 'POINT', >+}; > > foreach my $key (keys %{$new_attr}) { > $layout->set_attr($key => $new_attr->{$key}); >@@ -81,19 +83,24 @@ foreach my $key (keys %{$new_attr}) { > "Layout->set_attr() success on attribute $key."); > } > >- > # Testing Layout->save() method with a new object > my $sav_results = $layout->save(); > ok($sav_results ne -1, "Layout->save() success"); > > my $saved_layout; >-if ($sav_results ne -1) { >- # Testing Layout->retrieve() >- $new_attr->{'layout_id'} = $sav_results; >- ok($saved_layout = C4::Labels::Layout->retrieve(layout_id => $sav_results), >- "Layout->retrieve() success"); >- is_deeply($saved_layout, $new_attr, >- "Retrieved layout object is the expected"); >+# Testing Layout->retrieve() >+$new_attr->{'layout_id'} = $sav_results; >+ok($saved_layout = C4::Labels::Layout->retrieve(layout_id => $sav_results), >+ "Layout->retrieve() success"); >+ >+foreach my $key ( keys %{$new_attr} ) { >+ if ( $key eq 'scale_height' || $key eq 'scale_width' ) { >+ # workaround for is_deeply failing to compare scale_height and scale_width >+ is( $saved_layout->{$key} + 0.00, $new_attr->{$key} ); >+ } >+ else { >+ is( $saved_layout->{$key}, $new_attr->{$key} ); >+ } > } > > # Testing Layout->save() method with an updated object >-- >2.42.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10762
:
127729
|
134754
|
144900
|
144933
|
144939
|
144940
|
144941
|
154456
|
154457
|
154458
|
154459
|
154559
|
154560
|
154561
|
154562
|
157168
|
157169
|
157170
|
157171
|
157172
|
157999
| 158014