PdfTwigTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 40
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A formatProvider() 0 4 1
A testBasic() 0 12 2
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