View | Details | Raw Unified | Return to bug 10762
Collapse All | Expand All

(-)a/t/db_dependent/Labels/t_Label.t (-2 / +9 lines)
Lines 20-26 Link Here
20
20
21
use Modern::Perl;
21
use Modern::Perl;
22
22
23
use Test::More tests => 4;
23
use Test::More tests => 6;
24
use t::lib::TestBuilder;
24
use t::lib::TestBuilder;
25
use t::lib::Mocks;
25
use t::lib::Mocks;
26
26
Lines 99-104 my $dummy_template_values = { Link Here
99
    row_gap          => 0,
99
    row_gap          => 0,
100
    units            => 'INCH',
100
    units            => 'INCH',
101
    template_stat    => 1,
101
    template_stat    => 1,
102
    barcode_width    => 0.8,
103
    barcode_height   => 0.01
102
};
104
};
103
105
104
my $label_info = {
106
my $label_info = {
Lines 122-130 my $label_info = { Link Here
122
        label_width      => $dummy_template_values->{'label_width'},
124
        label_width      => $dummy_template_values->{'label_width'},
123
        left_text_margin => $dummy_template_values->{'left_text_margin'}
125
        left_text_margin => $dummy_template_values->{'left_text_margin'}
124
    ),
126
    ),
127
    scale_width => $dummy_template_values->{barcode_width},
128
    scale_height => $dummy_template_values->{barcode_height},
125
};
129
};
126
130
127
my $format_string = '100a 245a';
131
my $format_string = '100a 245a';
132
my $barcode_width = $label_info->{scale_width} * $label_info->{width};
133
my $barcode_height = $label_info->{scale_height} * $label_info->{height};
128
my $label = C4::Labels::Label->new(%$label_info, format_string => $format_string);
134
my $label = C4::Labels::Label->new(%$label_info, format_string => $format_string);
129
my $label_text = $label->create_label();
135
my $label_text = $label->create_label();
130
ok( defined $label_text, 'Label Text Value defined.' );
136
ok( defined $label_text, 'Label Text Value defined.' );
Lines 142-147 is_deeply( Link Here
142
        sprintf( "%s %s", $item->enumchron,      $item->copynumber )
148
        sprintf( "%s %s", $item->enumchron,      $item->copynumber )
143
    ]
149
    ]
144
);
150
);
151
is($barcode_width, '2.104',);
152
is($barcode_height, '0.01',);
145
153
146
$schema->storage->txn_rollback();
154
$schema->storage->txn_rollback();
147
155
148
- 

Return to bug 10762