File: test-autoload.php

package info (click to toggle)
tcpdf 6.11.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,884 kB
  • sloc: php: 53,114; sh: 333; makefile: 12
file content (39 lines) | stat: -rwxr-xr-x 688 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

require '/usr/share/php/tcpdf/autoload.php';

$pdf = new TCPDF();

if ($pdf instanceof TCPDF) {
    fwrite(STDOUT, '[OK] instanceof matches' . PHP_EOL);
} else {
    fwrite(STDERR, '[FAIL] instanceof matches' . PHP_EOL);
    exit(1);
}

$expectedHeaderData = [
    'logo' => '',
    'logo_width' => 30,
    'title' => '',
    'string' => '',
    'text_color' =>
    [
        0,
        0,
        0,
    ],
    'line_color' =>
    [
        0,
        0,
        0,
    ]
];

if ($pdf->getHeaderData() === $expectedHeaderData) {
    fwrite(STDOUT, '[OK] Header data matches' . PHP_EOL);
    exit(0);
}

fwrite(STDERR, '[FAIL] Header data does not match test' . PHP_EOL);
exit(1);