Passed
Push — feature/switch-to-phpunit ( 82614e )
by Konrad
03:39
created

TestCase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

4 Methods

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