TestCase   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDocumentInstance() 0 3 1
A setUp() 0 5 1
A getElementInstance() 0 3 1
A getParserInstance() 0 3 1
1
<?php
2
3
/**
4
 * @file This file is part of the PdfParser library.
5
 *
6
 * @author  Konrad Abicht <[email protected]>
7
 *
8
 * @date    2020-06-02
9
 *
10
 * @author  Sébastien MALOT <[email protected]>
11
 *
12
 * @date    2017-01-03
13
 *
14
 * @license LGPLv3
15
 *
16
 * @url     <https://github.com/smalot/pdfparser>
17
 *
18
 *  PdfParser is a pdf library written in PHP, extraction oriented.
19
 *  Copyright (C) 2017 - Sébastien MALOT <[email protected]>
20
 *
21
 *  This program is free software: you can redistribute it and/or modify
22
 *  it under the terms of the GNU Lesser General Public License as published by
23
 *  the Free Software Foundation, either version 3 of the License, or
24
 *  (at your option) any later version.
25
 *
26
 *  This program is distributed in the hope that it will be useful,
27
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
28
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29
 *  GNU Lesser General Public License for more details.
30
 *
31
 *  You should have received a copy of the GNU Lesser General Public License
32
 *  along with this program.
33
 *  If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>.
34
 */
35
36
namespace PHPUnitTests;
37
38
use PHPUnit\Framework\TestCase as PHPTestCase;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
39
use Smalot\PdfParser\Config;
40
use Smalot\PdfParser\Document;
41
use Smalot\PdfParser\Element;
42
use Smalot\PdfParser\Parser;
43
44
abstract class TestCase extends PHPTestCase
45
{
46
    /**
47
     * Contains an instance of the class to test.
48
     */
49
    protected $fixture;
50
51
    protected $rootDir;
52
53
    protected function setUp(): void
54
    {
55
        parent::setUp();
56
57
        $this->rootDir = __DIR__.'/../..';
58
    }
59
60
    protected function getDocumentInstance(): Document
61
    {
62
        return new Document();
63
    }
64
65
    protected function getElementInstance($value): Element
66
    {
67
        return new Element($value);
68
    }
69
70
    protected function getParserInstance(?Config $config = null): Parser
71
    {
72
        return new Parser([], $config);
73
    }
74
}
75