|
Lines 6-21
Link Here
|
| 6 |
use strict; |
6 |
use strict; |
| 7 |
use warnings; |
7 |
use warnings; |
| 8 |
|
8 |
|
| 9 |
use Test::More tests => 15; |
9 |
use Test::More tests => 16; |
| 10 |
|
10 |
|
| 11 |
BEGIN { |
11 |
BEGIN { |
| 12 |
use_ok('C4::Creators'); |
12 |
use_ok('C4::Creators'); |
| 13 |
use_ok('C4::Creators::PDF'); |
13 |
use_ok('C4::Creators::PDF'); |
| 14 |
} |
14 |
} |
| 15 |
|
15 |
|
| 16 |
my $pdf_creator = C4::Creators::PDF->new('test.pdf' => '', InitVars => 0); |
16 |
my $pdf_creator = C4::Creators::PDF->new(InitVars => 0); |
| 17 |
ok($pdf_creator, "testing new() works"); |
17 |
ok($pdf_creator, "testing new() works"); |
| 18 |
if (-e 'test.pdf') { |
18 |
if (-e $pdf_creator->{filename}) { |
| 19 |
pass('testing pdf file created'); |
19 |
pass('testing pdf file created'); |
| 20 |
} |
20 |
} |
| 21 |
else { |
21 |
else { |
|
Lines 40-45
is($pdf_creator->StrWidth("test", "H", 12), '19.344', "testing StrWidth() return
Link Here
|
| 40 |
is($result[0], '10', "testing Text() writes from a given x-value"); |
40 |
is($result[0], '10', "testing Text() writes from a given x-value"); |
| 41 |
is($result[1], '29.344', "testing Text() writes to the correct x-value"); |
41 |
is($result[1], '29.344', "testing Text() writes to the correct x-value"); |
| 42 |
|
42 |
|
|
|
43 |
open(my $fh, '>', 'test.pdf'); |
| 44 |
select $fh; |
| 45 |
|
| 43 |
ok($pdf_creator->End(), "testing End() works"); |
46 |
ok($pdf_creator->End(), "testing End() works"); |
| 44 |
|
47 |
|
|
|
48 |
close($fh); |
| 49 |
ok( -s 'test.pdf', 'test.pdf created' ); |
| 50 |
|
| 45 |
unlink 'test.pdf'; |
51 |
unlink 'test.pdf'; |
| 46 |
- |
|
|