PdfTwigTest::testBasic()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
namespace MewesK\TwigExcelBundle\Tests\Twig;
4
5
/**
6
 * Class PdfTwigTest
7
 * @package MewesK\TwigExcelBundle\Tests\Twig
8
 */
9
class PdfTwigTest extends AbstractTwigTest
10
{
11
    protected static $TEMP_PATH = '/../../tmp/pdf/';
12
13
    //
14
    // PhpUnit
15
    //
16
17
    /**
18
     * @return array
19
     */
20
    public function formatProvider()
21
    {
22
        return [['pdf']];
23
    }
24
25
    //
26
    // Tests
27
    //
28
29
30
    /**
31
     * @param string $format
32
     * @throws \Exception
33
     *
34
     * @dataProvider formatProvider
35
     */
36
    public function testBasic($format)
37
    {
38
        // Skip PDF test for nightly builds of PHP since mPDF doesn't work
39
        if (version_compare(phpversion(), '7.0.0-dev', '>=')) {
40
            return;
41
        }
42
43
        $path = $this->getDocument('cellProperties', $format);
44
45
        static::assertFileExists($path, 'File does not exist');
46
        static::assertGreaterThan(0, filesize($path), 'File is empty');
47
    }
48
}
49