Browse Source

Bug 14468: followup to fix tests

This patch fix an expected  test result.
Also changes a comparison for the return value to 'delete'
layout sub, in case of success it returns 'undef' and triggers
the message 'use of uninitialized value $del_results ...'

To test:
1) Whitout this patch

prove t/db_dependent/Labels/t_Layout.t

fails.

Also note the message
"Use of uninitialized value $del_results in string ne at t/db_dependent/Labels/t_Layout.t line 110."
for using the return value of delete layout (undef on success!)

2) Apply the patch
3) Test pass and no more message

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
3.22.x
Bernardo Gonzalez Kriegel 9 years ago
committed by Tomas Cohen Arazi
parent
commit
a299eef12d
  1. 4
      t/db_dependent/Labels/t_Layout.t

4
t/db_dependent/Labels/t_Layout.t

@ -102,11 +102,11 @@ my $updated_layout = C4::Labels::Layout->retrieve(layout_id => $sav_results);
is_deeply($updated_layout, $saved_layout, "Updated layout object is the expected");
# Testing Layout->get_text_wrap_cols()
is($updated_layout->get_text_wrap_cols(label_width => 180, left_text_margin => 18), 23,
is($updated_layout->get_text_wrap_cols(label_width => 180, left_text_margin => 18), 21,
"Layout->get_text_wrap_cols()");
# Testing Layout->delete()
my $del_results = $updated_layout->delete();
ok($del_results ne -1, "Layout->delete() success");
ok( ! defined($del_results) , "Layout->delete() success");
1;

Loading…
Cancel
Save