Completed
Pull Request — master (#300)
by Konrad
13:31 queued 09:23
created

TestCase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 27
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getElementInstance() 0 3 1
A getParserInstance() 0 3 1
A getDocumentInstance() 0 3 1
A setUp() 0 5 1
1
<?php
2
3
/**
4
 * @file This file is part of the PdfParser library.
5
 *
6
 * @author  Konrad Abicht <[email protected]>
7
 * @date    2020-06-02
8
 *
9
 * @author  Sébastien MALOT <[email protected]>
10
 * @date    2017-01-03
11
 *
12
 * @license LGPLv3
13
 * @url     <https://github.com/smalot/pdfparser>
14
 *
15
 *  PdfParser is a pdf library written in PHP, extraction oriented.
16
 *  Copyright (C) 2017 - Sébastien MALOT <[email protected]>
17
 *
18
 *  This program is free software: you can redistribute it and/or modify
19
 *  it under the terms of the GNU Lesser General Public License as published by
20
 *  the Free Software Foundation, either version 3 of the License, or
21
 *  (at your option) any later version.
22
 *
23
 *  This program is distributed in the hope that it will be useful,
24
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
25
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
 *  GNU Lesser General Public License for more details.
27
 *
28
 *  You should have received a copy of the GNU Lesser General Public License
29
 *  along with this program.
30
 *  If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>.
31
 */
32
33
namespace Test\Smalot\PdfParser;
34
35
use PHPUnit\Framework\TestCase as PHPTestCase;
36
use Smalot\PdfParser\Document;
37
use Smalot\PdfParser\Element;
38
use Smalot\PdfParser\Parser;
39
40
abstract class TestCase extends PHPTestCase
41
{
42
    /**
43
     * Contains an instance of the class to test.
44
     */
45
    protected $fixture;
46
47
    public function setUp()
48
    {
49
        parent::setUp();
50
51
        $this->rootDir = __DIR__.'/..';
0 ignored issues
show
Bug Best Practice introduced by
The property rootDir does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
52
    }
53
54
    protected function getDocumentInstance()
55
    {
56
        return new Document();
57
    }
58
59
    protected function getElementInstance($value)
60
    {
61
        return new Element($value);
62
    }
63
64
    protected function getParserInstance()
65
    {
66
        return new Parser();
67
    }
68
}
69